Ibotta / pure-predict

Machine learning prediction in pure Python
Apache License 2.0
86 stars 7 forks source link

[Question] Easy differentiation between RndmForest Scikit-learn and pure-predict upon loading #14

Closed JensBlack closed 3 years ago

JensBlack commented 3 years ago

Hi,

great package! I really like the simplicity and the speed improvement.

I have users that would like to be able to use both "versions" of the classifier and I would like to find an easy way to differentiate between the two directly after loading them.

so far I came up with based on it's object description:


    with open(path_to_sav,"rb") as f:
        clf= pickle.load(f)
    if 'pure' in str(clf):
       print(clf)

Output:
<pure_sklearn.ensemble._forest.RandomForestClassifierPure object at 0x00000201490EEF98>

Is there a better way to do this?

denver1117 commented 3 years ago

I think what you are doing seems reasonable 💯