dsauce
dsauce

Reputation: 612

Saving models from Python

Is it possible to save a predictive model in Python?

Background: I'm building regression models in SPSS and I need to share those when done. Unfortunately, no one else has SPSS.

Idea: My idea is to make the model in Python, do something XYZ, use another library to convert XYZ into and exe that will pick up a csv file with data and spit out the model fit results on that data. In this way, I can share the model with anyone I want without the need of SPSS or other expensive software

Challenge: I need to find out XYZ, how do I save the instance when the model is built. For example, in case of linear/logistic, it would be the set of coefficients.

PS: I'm using linear/logistic as examples, in reality, I need to share more complex models like SVM etc.

Upvotes: 1

Views: 166

Answers (2)

Matt
Matt

Reputation: 17629

Yes, this is possible. What you're looking for is scitkit-learn in combination with joblib. A working example of your problem can be found in this question.

Upvotes: 2

rickhg12hs
rickhg12hs

Reputation: 11932

Using FOSS (Free & Open Source Software) is great to facilitate collaboration. Consider using R or Sage (which has a Python backbone and includes R) so that you can freely share programs and data. Or even use Sagemath Cloud so that you can work collaboratively in real-time.

Upvotes: 2

Related Questions