Issue with function "learn" SMILE error -1

The engine.
Post Reply
suming
Posts: 4
Joined: Wed May 23, 2012 10:53 pm

Issue with function "learn" SMILE error -1

Post by suming »

Hi,

I have the newest copy of smile.jar for 32-bit linux.

It compiles fine but when I try to run it I get the error:

java -classpath ./smile.jar:. -Djava.library.path=. NaiveLearner
Exception in thread "main" smile.SMILEException: SMILE error -1 in function Learn
at smile.learning.NaiveBayes.learn(Native Method)
at NaiveLearner.main(naive_learner.java:24)

Here is my code:

class NaiveLearner{
public static void main(String[] args) {
Network net1 = new Network();
NaiveBayes naive = new NaiveBayes();
DataSet d = new DataSet();
d.readFile("naive.txt");
naive.setClassVariableId("type");
net1 = naive.learn(d);
net1.writeFile("naive_example.xdsl");
}
}

I might have just done something stupid, so sorry about that. Thanks in advance for the help!
Martijn
Posts: 76
Joined: Sun May 29, 2011 12:23 am

Re: Issue with function "learn" SMILE error -1

Post by Martijn »

Hi Sumin,

Most likely you'll need to correct:
naive.setClassVariableId("type");

Check if the column name is exactly "type"

To be safe you could check if the input file works properly in GeNIe.

Best,

Martijn
suming
Posts: 4
Joined: Wed May 23, 2012 10:53 pm

Re: Issue with function "learn" SMILE error -1

Post by suming »

Thanks a lot - that did the trick.
Post Reply