Open igorkurinnyi opened 3 years ago
Not sure its possible to train the models on newer versions, but for loading pretrained models on higher scikit-learn versions you can redirect imports so they're not looking for nonexistent paths From there repickle the model so you don't have to redirect the import everytime you want to load the model
import joblib
from sklearn.ensemble import _forest
from sklearn.tree import _classes
sys.modules['sklearn.tree.tree'] = _classes
sys.modules['sklearn.ensemble.forest'] = _forest
def dump_310():
# Dump the model with new references
model = joblib.load("/old_model.pkl.gz")
joblib.dump(model, "updated_model.pkl.gz", compress=3)
Hello,
Currently, dragnet is not compatible with scikit-learn > 0.21.3. I did research and composed a table of compatibilities of pickled dragnet models with new sklearn versions.
AttributeError: 'ExtraTreeClassifier' object has no attribute 'n_features_'
ModuleNotFoundError: No module named 'sklearn.ensemble._forest'
Models were trained with:
python 3.9
,Cython==0.29.24
,numpy==1.21.4
,scipy==1.7.2
Is it possible to update the library with new models? I could help with a pull request.