I am trying to use MLEM for saving and loading IsolationForest from sklearn.ensemble. As per the documentation, all sklearn models are supported - However, I get the below error for sklearn.ensemble.IsolationForest:
mlem.core.errors.HookNotFound: No suitable ModelHook for object of type "IsolationForest".
Registered hooks: [<class 'mlem.contrib.callable.CallableModelType'>, <class 'mlem.contrib.sklearn.SklearnModel'>,
<class 'mlem.contrib.sklearn.SklearnPipelineType'>, <class 'mlem.contrib.sklearn.SklearnTransformer'>]
Is there something wrong in my approach? Or is there an issue with the IsolationForest API in sklearn.
Code used:
from mlem.api import save
import pandas as pd
from sklearn.ensemble import IsolationForest, RandomForestRegressor
features = [
"sepal length (cm)",
"sepal width (cm)",
"petal length (cm)",
"petal width (cm)",
]
df = pd.DataFrame([[0, 1, 2, 3], [0, 1, 2, 3], [0, 1, 2, 3]], columns=features)
y = [0, 1, 2]
iff = IsolationForest()
iff.fit(df)
save(iff, "models/iff", sample_data=df)
I am trying to use MLEM for saving and loading IsolationForest from sklearn.ensemble. As per the documentation, all sklearn models are supported - However, I get the below error for sklearn.ensemble.IsolationForest:
Is there something wrong in my approach? Or is there an issue with the IsolationForest API in sklearn.
Code used: