You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(onehot): encode categories before onehot_from_ordinal
``categorical_method="onehot_from_ordinal"`` appended only
``OneHotFromOrdinalTransformer``, which requires input that is already ordinal
encoded. The Preprocessor hands it raw column values, so any string column died
inside ``np.max(X, axis=0).astype(int)`` with a bare
ValueError: invalid literal for int() with base 10: 'c'
that says nothing about the chosen method. Since ``_detect_column_types`` routes
every non-numeric column to the categorical side, this was the common case.
Insert ``ContinuousOrdinalTransformer`` ahead of it so the method does what the
Preprocessor docstring already claimed -- integer codes, then one-hot. Because
that encoder numbers categories from 1 and reserves 0 for unseen values, a
column with k categories expands to k + 1 columns and categories unseen at fit
time land in the reserved column instead of producing an all-zero row.
Docs reconciled: the Preprocessor docstring, the user-guide table and the class
itself previously gave three different accounts of this method.
Closes#17
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments