简体   繁体   中英

How can I use a model I trained to make predictions in the future without retraining whenever I want to use it

I recently finished training a linear regression algorithm but I don't know how to save it so that in the future, I can use it to make relevant predictions without having to retrain it whenever I want to use it.

Do I save the.py file and call it whenever I need it or create a class or what?

I just want to know how I can save a model I trained so I can use it in the future.

Depending on how you make the linear regression, you should be able to obtain the equation of the regression, as well as the values of the coefficients, most likely by inspecting the workspace.

If you explain what module, function, or code you use to do the regression, it will be easier to give a specific solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM