-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is sklearn2pmml supported by scikit-tree? #255
Comments
Hi @huangliqiao unsure! Never tried, and unfamiliar with sklearn2pmml. Are you able to provide some more information as to what is missing? Is it the pickling step, or something else? |
Hi Adam, thanks for replying. sktree works fine with pickle, but I need a model that can be loaded by Java. So I tried sklearn2pmml, and obviously it failed. Is there any workaround to save the scikit-tree model that can be used by Java? |
Spotted this discussion, and it got me interested in exploring the concept of oblique trees. Now, I've just released SkLearn2PMML version 0.107.0, which adds support for all Scikit-Tree's oblique decision tree estimator, and oblique decision tree ensemble estimator classes, including the Here's a demo: from sklearn.datasets import load_iris
from sktree.ensemble import ExtendedIsolationForest
iris_X, iris_y = load_iris(return_X_y = True, as_frame = True)
eif = ExtendedIsolationForest(n_estimators = 13)
eif.fit(iris_X)
from sklearn2pmml import sklearn2pmml
sklearn2pmml(eif, "ExtendedIsolationForestIris.pmml") So, I believe this issue can be closed as "fixed". |
@huangliqiao Let us know if the issue can be closed? |
I tried to use sklearn2pmml to save the model trained by sktree.ensemble.ExtendedIsolationForest as pmml format, but it failed.
versions:
scikit-learn 1.4.0
scikit-tree 0.7.0
sklearn2pmml 0.105.2
code:
error:
Standard output is empty
Standard error:
Exception in thread "main" net.razorvine.pickle.PickleException: expected zero arguments for construction of ClassDict (for sktree.tree._oblique_tree.ObliqueTree). This happens when an unsupported/unregistered class is being unpickled that requires construction arguments. Fix it by registering a custom IObjectConstructor for this class.
at net.razorvine.pickle.objects.ClassDictConstructor.construct(ClassDictConstructor.java:23)
at net.razorvine.pickle.Unpickler.load_reduce(Unpickler.java:759)
at net.razorvine.pickle.Unpickler.dispatch(Unpickler.java:200)
at org.jpmml.python.CustomUnpickler.dispatch(CustomUnpickler.java:32)
at org.jpmml.python.PickleUtil$1.dispatch(PickleUtil.java:65)
at net.razorvine.pickle.Unpickler.load(Unpickler.java:110)
at org.jpmml.python.PickleUtil.unpickle(PickleUtil.java:86)
at com.sklearn2pmml.Main.run(Main.java:75)
at com.sklearn2pmml.Main.main(Main.java:65)
The text was updated successfully, but these errors were encountered: