hi
I try to get the prediction of an instance but not possible my code is:
LinearRegression linear = new LinearRegression();
linear.buildClassifier(entrenamiento);
double pred = linear.classifyInstance(test.instance(0));
System.out.print("ID: " + test.instance(i).value(0));
System.out.print(", actual: " + test.classAttribute().value((int) test.instance(0).classValue()));
System.out.println(", predicted: " + test.classAttribute().value((int) pred));
I tested with weka and I get the perfect result:
=== Predictions on test set ===
inst# actual predicted error
1 ? 12 ?
thanks..
I try to get the prediction of an instance but not possible my code is:
LinearRegression linear = new LinearRegression();
linear.buildClassifier(entrenamiento);
double pred = linear.classifyInstance(test.instance(0));
System.out.print("ID: " + test.instance(i).value(0));
System.out.print(", actual: " + test.classAttribute().value((int) test.instance(0).classValue()));
System.out.println(", predicted: " + test.classAttribute().value((int) pred));
I tested with weka and I get the perfect result:
=== Predictions on test set ===
inst# actual predicted error
1 ? 12 ?
thanks..