[doc] Clarify the effect of enable_categorical (#9877)

This commit is contained in:
david-cortes
2023-12-13 01:39:41 +01:00
committed by GitHub
parent d530d37707
commit 42173d7bc3
3 changed files with 36 additions and 6 deletions

View File

@@ -822,8 +822,18 @@ class DMatrix: # pylint: disable=too-many-instance-attributes,too-many-public-m
.. note:: This parameter is experimental
Experimental support of specializing for categorical features. JSON/UBJSON
serialization format is required.
Experimental support of specializing for categorical features.
If passing 'True' and 'data' is a data frame (from supported libraries
such as Pandas or Modin), columns of categorical types will automatically
be set to be of categorical type (feature_type='c') in the resulting DMatrix.
If passing 'False' and 'data' is a data frame with categorical columns,
it will result in an error being thrown.
If 'data' is not a data frame, this argument is ignored.
JSON/UBJSON serialization format is required for this.
"""
if group is not None and qid is not None: