diff --git a/sklearn2pmml/preprocessing/__init__.py b/sklearn2pmml/preprocessing/__init__.py index 94cdc91..705a002 100644 --- a/sklearn2pmml/preprocessing/__init__.py +++ b/sklearn2pmml/preprocessing/__init__.py @@ -98,6 +98,7 @@ def __init__(self, dtype): def fit(self, X, y = None): if self.dtype == "category": + X = to_numpy(X) nonmissing_mask = pandas.notnull(X) categories = numpy.unique(X[nonmissing_mask]) self.dtype_ = CategoricalDtype(categories, ordered = False)