-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save and reload trained models #156
Comments
Could you show your code for pickling? Have you got an error? |
I did:
I got this error: |
Ok. That was fixed recently for Kriging based surrogates at least (see #154). So you have to install SMT from GitHub. |
Ah ok, thank you very much. |
I've just released SMT 0.3.3, you can try it with: pip install -U smt Regarding, IDW and RBF, do you get an error? I am not sure but I think it had worked for me. |
It gives me this error:
I have no clue what is about |
My bad. Indeed it does not work for IDW and RBF and other surrogates using a Cython extensions. Those require special handling (see stackoverflow related question). |
But if I save KPLS, do I need to retrain the model or can I load directly to predict new points? Because I am not able to do that. |
Hi,
If you have questions about SMT, please open a new detailed issue on smt GitHub here https://github.com/SMTorg/SMT/issues <https://github.com/SMTorg/SMT/issues>
It will be more useful for you because there are other SMT developers who can answer your questions as well.
Thank you,
Mohamed
… On Jul 24, 2019, at 2:53 PM, ArioBattolla ***@***.***> wrote:
But if I save KPLS, do I need to retrain the model or can I load directly to predict new points? Because I am not able to do that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#156?email_source=notifications&email_token=AEOLWT6KI53LLC3MZFXIXGLQBBNGNA5CNFSM4H4DU2NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2WM7SY#issuecomment-514641867>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AEOLWTZH66LXF2SKZTRTBPLQBBNGNANCNFSM4H4DU2NA>.
|
What is going on? After the dump, you should be able to load the KPLS surrogate using |
Hello @relf ,
My code is nearly the same as the OP, though I get a different error: Thanks |
@ldallen-crrel No, we have not work specifically on surrogates dump, I've just referenced the link I found after a 2-minutes search. I've started to make pickling work for kriging-based ones but as I said Cython extensions require special handling. I've not planned to work on that, but it would be a great contribution to SMT. What do you mean by OP? |
Thank you for the reply. By OP, I only meant the original poster (ArioBattolla). |
Bumping this after some time passed. Has this been resolved? Or has anyone found a workaround? I still get the following error when saving some models (e.g. RBF): |
Nothing has evolved on this point. You get an error as it is not implemented (hence the open status of this issue). As far as I am concerned, I do not work on this but I will be happy to integrate a PR on this topic. |
Bumping on this again, for future reference, note that even if they can not be pickled directly, RBF, IDW, RMTS (like QP and LS) training operation can be cached. These surrogates have a |
A section on this topic is added to the documentation. |
How can I save and reload trained models?
I tried to pickle them, but it does not work.
I would like to train once and then use the trained model in another python file to predict data points.
Thank you very much, your package is incredible!
The text was updated successfully, but these errors were encountered: