Installation JSMILE - Python

The engine.
Post Reply
dvrebos
Posts: 6
Joined: Thu Jun 08, 2017 10:24 am

Installation JSMILE - Python

Post by dvrebos »

Hello,

I am trying to get JSMILE to run in python (windows 10 - 64bit). But I can't figure out where to get the different files that are mentioned in the wiki. In the introduction to JSMILE two different packages are mentioned:

1. jSMILE X Y Z: compiled jSMILE library version X.Y for platform Z.
2. SMILE Wrappers Sources:
jsmile\c_library\ - C++ language side of the library (with Microsoft Visual Studio 2003 [version 7.1] project)
jsmile\java_library\ - Java language side of the library (with Eclipse project)

At the download page (academic) there are downloads for SMILE (smile_vc14_x64.zip) and JSMILE (jsmile_win64.zip). But they don't contain the above mentioned c_library and java_library.

Has the installation of JSMILE changed or am I missing something obvious?

Thank you.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Installation JSMILE - Python

Post by shooltz[BayesFusion] »

jSMILE consists of two files: smile.jar and a JNI library, a name of which is platform-specific. For x64, the JNI part of jSMILE is called jsmile.dll. To use jSMILE from Python you only need to download jsmile_win64.zip.

If you plan to use JPype to call jSMILE from Python, see this forum thread for more info:
http://support.bayesfusion.com/forum/vi ... f=2&t=3749
dvrebos
Posts: 6
Joined: Thu Jun 08, 2017 10:24 am

Re: Installation JSMILE - Python

Post by dvrebos »

Thank you for the information. I've been able to make the connection between JSMILE, JPype, JAVA and Python and I can read existing networks made in GENIE.

But I have problems to define Node Type or Bayesian Algorithm Type when creating a network in JSMILE. In the wiki of JSMILE is written:

The available algorithms are enumerated in the BayesianAlgorithmType inner class.

But it's not clear to me how I can get an overview of these inner classes in python. I would expect something like this to work:

Code: Select all

from jpype import *
jvmCP = "-Djava.class.path=c:/SMILE/JSMILE/smile.jar"
jvmLP = "-Djava.library.path=c:/SMILE/JSMILE"
startJVM(getDefaultJVMPath(),jvmCP,jvmLP)

smile = JPackage("smile")

print smile.BayesianAlgorithmType()
But I'm clearly missing something.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Installation JSMILE - Python

Post by shooltz[BayesFusion] »

I don't have Python installed now, so I can't help you with the inner class issue at this point.

Network.NodeType, Network.BayesianAlgorithmType and similiar classes contain only 'static final int' members, so you don't have to instantiate the objects of these classes. The numeric values are stable and you can copy them from Network.java, which is available as part of jSMILE's sources downloadable from our website.
Post Reply