Skip to content

Using with Sklearn and Python #14

@jgerlitz

Description

@jgerlitz

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions