You could save it with pickle as normally, and then load it from a python
process (or daemon) and expose a REST API to query it, or any other form of
IPC/RPC, depending on the expected caller and deployment you want to do.


On Mon, Jun 16, 2014 at 6:12 PM, Maheshakya Wijewardena <
pmaheshak...@gmail.com> wrote:

> Hi George,
>
> You can use Python pickle to save your model.
>
> import pickle
>> with open('my_model.pickle', 'wb') as handle:
>>     pickle.dump(model, handle)
>>
>
> then it can be loaded again with:
>
> model = pickle.load(open(''my_model.pickle', 'rb'))
>>
>
> But this should be done with Python. To use the model with Java, you will
> have to use Jython or any other supported framework to call Python
> functions from Java.
> See :
> http://stackoverflow.com/questions/8898765/calling-python-in-java
>
> Hope this would help you.
>
> Regards,
> Maheshakya
>
>
> On Mon, Jun 16, 2014 at 8:20 PM, George Bezerra <gbeze...@gmail.com>
> wrote:
>
>> Hi!
>>
>> I have a trained scikit learn model that I would like to export to
>> production. The idea is to have this model loaded into memory and
>> accessible through another language, such as Java or PhP. The application
>> would query the model with some input data and the model would spit out the
>> result.
>>
>> Any ideas/experience with this?
>>
>> Thanks!
>>
>> --
>> George Bezerra
>>
>>
>> ------------------------------------------------------------------------------
>> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
>> Find What Matters Most in Your Big Data with HPCC Systems
>> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
>> http://p.sf.net/sfu/hpccsystems
>> _______________________________________________
>> Scikit-learn-general mailing list
>> Scikit-learn-general@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>
>>
>
>
> --
> Undergraduate,
> Department of Computer Science and Engineering,
> Faculty of Engineering.
> University of Moratuwa,
> Sri Lanka
>
>
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to