Examples of SVMPropertyPredictor


Examples of org.data2semantics.proppred.predictors.SVMPropertyPredictor

      bl.addAll(dataset.getStatementsFromStrings(null, "http://swrc.ontoware.org/ontology#employs", instance.toString()));
      blackLists.put(instance, bl);
    }

    // Create a new SVM property predictor
    SVMPropertyPredictor pred = new SVMPropertyPredictor();
   
    // Train on the first 100 instances
    pred.train(dataset, instances.subList(0, 100), labels.subList(0, 100), blackLists);
   
    // Predict on the rest, note that we also need the blacklists here, since the labels already occur in the test set as well,
    // because we do not use an unlabeled test set, which we would use in an application setting.
    List<Value> predictions = pred.predict(dataset, instances.subList(100,instances.size()), blackLists);
   
    // Make a sublist of the labels of the test set
    List<Value> testLabels = labels.subList(100, labels.size());

    // Print out the predictions and compute the accuracy on the test set.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.