use of org.apache.ignite.ml.math.exceptions.knn.SmallTrainingDatasetSizeException in project ignite by apache.
the class KNNClassificationTest method testLargeKValue.
/**
*/
public void testLargeKValue() {
IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName());
double[][] mtx = new double[][] { { 10.0, 10.0 }, { 10.0, 20.0 }, { -1, -1 }, { -2, -2 }, { -1.0, -2.0 }, { -2.0, -1.0 } };
double[] lbs = new double[] { 1.0, 1.0, 1.0, 2.0, 2.0, 2.0 };
LabeledDataset training = new LabeledDataset(mtx, lbs);
try {
new KNNModel(7, new EuclideanDistance(), KNNStrategy.SIMPLE, training);
fail("SmallTrainingDatasetSizeException");
} catch (SmallTrainingDatasetSizeException e) {
return;
}
fail("SmallTrainingDatasetSizeException");
}
Aggregations