manifoldai / merf

Mixed Effects Random Forest
MIT License
219 stars 52 forks source link

saving merf as a pickle #37

Closed jyu-theartofml closed 4 years ago

jyu-theartofml commented 4 years ago

Hi, it took me a long time to train the MERF on my dataset. After training, I tried saving it as a pickle object and reload it to make prediction on test data. However, I got an error saying the pkl is a dictionary that doesn't have a predict method. Any ideas on how to get around this? I don't want to train the model every time I pass new test data. Thanks.

AttributeError                            Traceback (most recent call last)

<ipython-input-55-0bd2bd5ab064> in <module>()
----> 1 y_hat_known_merf = loaded_model.predict(X_known, Z_known, clusters_known)
      2 y_hat_known_merf

AttributeError: 'dict' object has no attribute 'predict'
resdntalien commented 4 years ago

@jyu-theartofml Thanks for the issue. We will try to take a look at this when we get some time and add a unit test for it.