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.

Get Hands-On Artificial Intelligence with Java for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.