Why?
Categorical features with many categories are useful for modeling random effects, e.g. modeling the zip code of voters, or the clinician id of medical diagnoses.
Also, support for two feature types (initially two very similar feature types) will make it much easier to support a third type such as real/normal data in #22 .
How?
The main bottleneck in TreeCat is space and time used to process internal ragged data:
- categoricals are represented as one-hot vectors in a ragged array, hence take
O(#cats) space
- these one-hot vectors are processed cell-by-cell in both training and serving
To reduce these costs, the internal format can split from one datatype (multinomial) to two datatypes (multinomial and categorical), where categorical data is restricted to zero or one observation. Some plumbing already exists to pass a feature_types vector to the trainer, and to represent internal data as a Table object with heterogeneous data.
training.pyto useTableobjects.serving.pyto useTableobjects.Tableobjects for multi-row inputs.Tableobjects for single-row inputs. (Is this efficient?)categoricaldata inTableobjects.format.pyto optionally create sparsecategoricaldata.categoricaldata in training.categoricaldata in serving.Why?
Categorical features with many categories are useful for modeling random effects, e.g. modeling the zip code of voters, or the clinician id of medical diagnoses.
Also, support for two feature types (initially two very similar feature types) will make it much easier to support a third type such as real/normal data in #22 .
How?
The main bottleneck in TreeCat is space and time used to process internal ragged data:
O(#cats)spaceTo reduce these costs, the internal format can split from one datatype (multinomial) to two datatypes (multinomial and categorical), where categorical data is restricted to zero or one observation. Some plumbing already exists to pass a
feature_typesvector to the trainer, and to represent internal data as aTableobject with heterogeneous data.