-
Notifications
You must be signed in to change notification settings - Fork 33
Using with Sklearn and Python #14
Description
I'm attempting to use this for the random forests I've generated using the sklearn package in python, and my code runs fine in R using repl_python(), but when I get to the step of creating the tree (repr <- ReprTree(py$mod, py$data1)) it stays that it can't be run due to "Error in UseMethod("predict2"). Full error below:
Error in UseMethod("predict2") :
no applicable method for 'predict2' applied to an object of class "c('sklearn.ensemble._forest.RandomForestClassifier', 'sklearn.ensemble._forest.ForestClassifier', 'sklearn.base.ClassifierMixin', 'sklearn.ensemble._forest.BaseForest', 'sklearn.base.MultiOutputMixin', 'sklearn.ensemble._base.BaseEnsemble', 'sklearn.base.MetaEstimatorMixin', 'sklearn.base.BaseEstimator', 'python.builtin.object')"
Has anyone dealt with this before, and if so, is there a way around it?