List of usage examples for org.apache.mahout.classifier.df.data Data isEmpty
public boolean isEmpty()
From source file:com.wsc.myexample.decisionForest.MyDecisionForest.java
License:Apache License
/** * Classifies the data and calls callback for each classification *///from w w w . j a v a 2 s .c om public void classify(Data data, double[] predictions) { Preconditions.checkArgument(data.size() == predictions.length, "predictions.length must be equal to data.size()"); if (data.isEmpty()) { return; // nothing to classify } for (Node tree : trees) { for (int index = 0; index < data.size(); index++) { predictions[index] = tree.classify(data.get(index)); } } }