Open dintellect opened 1 year ago
You can read about our supported operators in our wiki.
I don't think this one is on the list, see in particular "Preprocessing". Can you please post your code and we can add it to the feature requests?
Below is the code:
# ML Libraries
from sklearn.preprocessing import OrdinalEncoder
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
import xgboost as xgb
#Ordinal Encoding
categorical_transformer = OrdinalEncoder(handle_unknown="use_encoded_value", unknown_value=-1)
preprocessor = ColumnTransformer(transformers=[("cat", categorical_transformer, categorical_features),])
#Scikit Learn Pipeline
clf = Pipeline(steps=[("preprocessor", preprocessor),("classifier", model)])
#Model Training
clf.fit(X_train, y_train)
#Conversion
from hummingbird.ml import convert
hb_model = convert(clf, 'torch',X_train[0:1])
Thanks we'll take a look!
In the meantime, see maybe OneHotEncoder
(which we support) could work (but might not depending on your dataset).
Which Scikit-learn pipeline operators do hummingbird support?