Making predictions with semi-supervised machine learning models
Now, we'll look into how to make predictions using our trained model. Consider the following code:
import weka.core.Instances; import weka.core.converters.ConverterUtils.DataSource; import weka.classifiers.collective.functions.LLGC; import weka.classifiers.collective.evaluation.Evaluation;
We will be importing two JAR libraries, as follows:
- The
weka.jar
library - The
collective-classification-<date>.jar
library
Therefore, we will take the two base classes, Instances
and DataSource
, and we will use the LLGC
class (since we have trained our model using LLGC
) from the collective-classifications
package, as well as the Evaluation
class from the collective-classifications
package.
We will first assign an ARFF file to our DataSource
object; we'll read it into the memory, in an Instances
object. We'll assign a class attribute to our Instances
object, and then, we will build our model:
public static void main(String[] args) { try{...