2012/10/26 Didier Vila <dv...@capquestco.com>:
> Good Afternoon all,
>
> I have two questions that can look naive as I don’t know Jython and the
> difference with Python.
>
> In the future, I should potentially create and converted  python- with
> scikit learn codes to JAR files . Later on, these JAR files  will be used
> and executed by another system.

Most likely, your end goal is not to generate jars but to exectue
scikit-learn models (either for training or predictions or maybe both)
on a Java virtual machines. Nobody on earth is interested in generated
jar files per se :)

> Question 1: Is it possible to create Jar file from Python ? Or Should I use
> Jython for the JAR file ?

A jar is mostly a zip archive that holds the byte code of compiled
java classes and additional resources such as configuration files or
data files used by the java classes. Python can allow you to create a
zip archive but as it won't allow you to compile java code to generate
the java byte code so I don't see the point of generating jar files
from python. Use a Java build tools (OpenJDK + ant or maven for
instance) to build your jars.

> Question 2: If I need to use Jython,  I was wondering if it’s possible to
> install/use ScikitLearn in Jython  and all my code that I develop in Python
> ?

Nope because jython will not allow you to use C compiled extensions.
And both scikit-learn and its dependencies (numpy and scipy) are full
of compiled C extensions. The only Python intepreter able to execute
scikit-learn / numpy and scipy as of today is CPython (the official
python interpreter from python.org).

Maybe you should have a look at jepp or jpype instead (depending if
you want to call CPython programs from a Java runtime or the
converse):

http://jepp.sourceforge.net/
http://jpype.sourceforge.net/

See also: 
http://stackoverflow.com/questions/12738827/how-can-i-call-scikit-learn-classifiers-from-java

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to