causalml icon indicating copy to clipboard operation
causalml copied to clipboard

UpliftRandomForestClassifier Model object cannot be pickled when saving as joblib

Open maheshv26 opened this issue 2 years ago • 2 comments

UpliftRandomForestClassifier Model object cannot be pickled when saving as joblib. There seems to be no way to save UpliftRandomForestClassifier Model object

maheshv26 avatar Dec 10 '22 09:12 maheshv26

You can use pickle:

import pickle
pickle.dump(urf_model, open("urf-model.pickle", 'wb'))

where urf_model is the fitted UpliftRandomForestClassifier

jroessler avatar Jan 03 '23 09:01 jroessler

I got the same issue

PicklingError:can't pickle <cyfunction UpliftTreeClassifier.evaluate_KL at 0x7fc2a6f1fd90>:attribute lookup evaluate_KL on causalml.inference.tree.uplift failed

How can I fix it?

GeTuojian avatar Mar 10 '23 11:03 GeTuojian