1
$\begingroup$

I have a predictive model in IPython notebook. How can I create dll or exe from it? And is it possible to save in executable file already trained model?

I want a program with very simple syntax(X - file with objects, out -- file with answers):

./model X out

I don't know if is appropriate community for this question. If not, I'll delete it.

$\endgroup$
3
$\begingroup$

You'll need to copy, or convert*, your IPython code (I think) into a Python script. After that you can use software such as py2exe to create a standalone application. Other hypothesis are:

It's possible to save data inside the scripts (it will be compiled the same way as code as long as it is valid). Other possibility is to save in an external file and just load the data on execution. If the data is in a class check pickle to save it to a file.

  • as @dmb suggested.

EDIT: Ah I forgot to mention the arguments. That is easily achievable. Check this Question in SO.

$\endgroup$
2
2
$\begingroup$

You can convert your ipython notebook to a variety of different formats. If I were you, I would convert it to a .py file, and organize your code to take in sys.argv 'X' and 'out' for reading and writing your data. Then at the CLI, you can type

python ./model.py X out

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.