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
{{ message }}
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
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)