Skip to content

Models cannot be saved and restored #2

@johann-petrak

Description

@johann-petrak
  1. attempt to save a trained CostSensitiveRandomForestClassifier model using python pickle
  • pickle.dump(model,open("m1","wb")) ## works without an error
  • m=pickle.load(open("m1","rb")) ## fails with error "AttributeError: 'module' object has no attribute '_tree_class'"
  1. attempt to save the same model using joblib.dump from sklearn.externals.joblib:
  • joblib.dump(model,"m2") ## fails with error "PicklingError: Can't pickle <class costcla.models.cost_tree._tree_class at 0x7f45d8760db8>: it's not found as costcla.models.cost_tree._tree_class"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions