ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ch...@apache.org
Subject [2/2] ignite git commit: IGNITE-7454 Wrong package in IgniteExamplesMLTestSuite
Date Fri, 19 Jan 2018 11:59:20 GMT
IGNITE-7454 Wrong package in IgniteExamplesMLTestSuite

this closes #3393


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cb1233a0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cb1233a0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cb1233a0

Branch: refs/heads/master
Commit: cb1233a03f8b58a0834dd22a2319fab084a3f04b
Parents: 2ea76fc
Author: Oleg Ignatenko <oignatenko@gridgain.com>
Authored: Fri Jan 19 14:59:01 2018 +0300
Committer: Yury Babak <ybabak@gridgain.com>
Committed: Fri Jan 19 14:59:01 2018 +0300

----------------------------------------------------------------------
 .../ignite/examples/datagrid/package-info.java  |   2 +-
 .../testsuites/IgniteExamplesMLTestSuite.java   |  52 ++-
 .../testsuites/IgniteExamplesSelfTestSuite.java |   5 +-
 ...uzzyCMeansDistributedClustererBenchmark.java | 130 ++++++
 ...gniteFuzzyCMeansLocalClustererBenchmark.java |  93 ++++
 .../ignite/yardstick/ml/knn/Datasets.java       | 453 +++++++++++++++++++
 .../knn/IgniteKNNClassificationBenchmark.java   |  73 +++
 .../ml/knn/IgniteKNNRegressionBenchmark.java    |  82 ++++
 .../ignite/yardstick/ml/knn/package-info.java   |  22 +
 ...iteSparseDistributedMatrixMul2Benchmark.java |  74 +++
 ...uzzyCMeansDistributedClustererBenchmark.java | 130 ------
 ...gniteFuzzyCMeansLocalClustererBenchmark.java |  93 ----
 .../ignite/yardstick/ml/knn/Datasets.java       | 453 -------------------
 .../knn/IgniteKNNClassificationBenchmark.java   |  73 ---
 .../ml/knn/IgniteKNNRegressionBenchmark.java    |  82 ----
 .../ignite/yardstick/ml/knn/package-info.java   |  22 -
 ...iteSparseDistributedMatrixMul2Benchmark.java |  74 ---
 17 files changed, 963 insertions(+), 950 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/examples/src/main/java/org/apache/ignite/examples/datagrid/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/package-info.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/package-info.java
index e8c54ac..cfa37a4 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/package-info.java
@@ -19,4 +19,4 @@
  * <!-- Package description. -->
  * Demonstrates data ignite cache usage.
  */
-package org.apache.ignite.examples.jav.datagrid;
\ No newline at end of file
+package org.apache.ignite.examples.datagrid;

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java
index bc917b9..d2f40e6 100644
--- a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java
+++ b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesMLTestSuite.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.ml.testsuites;
+package org.apache.ignite.testsuites;
 
 import java.io.File;
 import java.io.IOException;
@@ -38,11 +38,19 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_OVERRIDE_MCAST_GRP
 /**
  * Examples test suite.
  * <p>
- * Contains only Spring ignite examples tests.
+ * Contains only ML Grid Ignite examples tests.</p>
  */
 public class IgniteExamplesMLTestSuite extends TestSuite {
+    /** Base package to create test classes in. */
+    private static final String basePkgForTests = "org.apache.ignite.examples.ml";
+
+    /** Test class name pattern. */
+    private static final String clsNamePtrn = ".*Example$";
+
     /**
-     * @return Suite.
+     * Creates test suite for Ignite ML examples.
+     *
+     * @return Created suite.
      * @throws Exception If failed.
      */
     public static TestSuite suite() throws Exception {
@@ -51,8 +59,8 @@ public class IgniteExamplesMLTestSuite extends TestSuite {
 
         TestSuite suite = new TestSuite("Ignite ML Examples Test Suite");
 
-        for (Class clazz : getClasses("org.apache.ignite.examples.ml", ".*Example$"))
-            suite.addTest(new TestSuite(makeTestClass(clazz, "org.apache.ignite.ml.examples")));
+        for (Class clazz : getClasses(basePkgForTests))
+            suite.addTest(new TestSuite(makeTestClass(clazz)));
 
         return suite;
     }
@@ -60,13 +68,12 @@ public class IgniteExamplesMLTestSuite extends TestSuite {
     /**
      * Creates test class for given example.
      *
-     * @param exampleCls Class of the example to be tested
-     * @param basePkgForTests Base package to create test classes in
-     * @return Test class
-     * @throws NotFoundException if class not found
-     * @throws CannotCompileException if test class cannot be compiled
+     * @param exampleCls Class of the example to be tested.
+     * @return Test class.
+     * @throws NotFoundException If class not found.
+     * @throws CannotCompileException If test class cannot be compiled.
      */
-    private static Class makeTestClass(Class<?> exampleCls, String basePkgForTests)
+    private static Class makeTestClass(Class<?> exampleCls)
         throws NotFoundException, CannotCompileException {
         ClassPool cp = ClassPool.getDefault();
         cp.insertClassPath(new ClassClassPath(IgniteExamplesMLTestSuite.class));
@@ -87,12 +94,12 @@ public class IgniteExamplesMLTestSuite extends TestSuite {
     /**
      * Scans all classes accessible from the context class loader which belong to the given package and subpackages.
      *
-     * @param pkgName The base package
-     * @return The classes
-     * @throws ClassNotFoundException if some classes not found
-     * @throws IOException if some resources unavailable
+     * @param pkgName The base package.
+     * @return The classes.
+     * @throws ClassNotFoundException If some classes not found.
+     * @throws IOException If some resources unavailable.
      */
-    private static List<Class> getClasses(String pkgName, String clsNamePtrn) throws ClassNotFoundException, IOException {
+    private static List<Class> getClasses(String pkgName) throws ClassNotFoundException, IOException {
         String path = pkgName.replace('.', '/');
 
         Enumeration<URL> resources = Thread.currentThread()
@@ -111,15 +118,17 @@ public class IgniteExamplesMLTestSuite extends TestSuite {
     }
 
     /**
-     * Recursive method used to find all classes in a given directory and subdirs.
+     * Recursive method used to find all classes in a given directory and sub-dirs.
      *
-     * @param dir The base directory
-     * @param pkgName The package name for classes found inside the base directory
-     * @return The classes
-     * @throws ClassNotFoundException if class not found
+     * @param dir The base directory.
+     * @param pkgName The package name for classes found inside the base directory.
+     * @param clsNamePtrn Class name pattern.
+     * @return The classes.
+     * @throws ClassNotFoundException If class not found.
      */
     private static List<Class> findClasses(File dir, String pkgName, String clsNamePtrn) throws ClassNotFoundException {
         List<Class> classes = new ArrayList<>();
+
         if (!dir.exists())
             return classes;
 
@@ -130,6 +139,7 @@ public class IgniteExamplesMLTestSuite extends TestSuite {
                     classes.addAll(findClasses(file, pkgName + "." + file.getName(), clsNamePtrn));
                 else if (file.getName().endsWith(".class")) {
                     String clsName = pkgName + '.' + file.getName().substring(0, file.getName().length() - 6);
+
                     if (clsName.matches(clsNamePtrn))
                         classes.add(Class.forName(clsName));
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
index 0eea40a..1eeedf7 100644
--- a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
+++ b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
@@ -50,7 +50,7 @@ import org.apache.ignite.examples.TaskExamplesSelfTest;
 /**
  * Examples test suite.
  * <p>
- * Contains only Spring ignite examples tests.
+ * Contains all Ignite examples tests.</p>
  */
 public class IgniteExamplesSelfTestSuite extends TestSuite {
     /**
@@ -96,6 +96,9 @@ public class IgniteExamplesSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(CacheClientBinaryExampleTest.class));
         suite.addTest(new TestSuite(ComputeClientBinaryExampleTest.class));
 
+        // ML Grid.
+        suite.addTest(IgniteExamplesMLTestSuite.suite());
+
         return suite;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java
new file mode 100644
index 0000000..e356746
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.yardstick.ml.clustering;
+
+import java.util.Map;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.ml.clustering.BaseFuzzyCMeansClusterer;
+import org.apache.ignite.ml.clustering.FuzzyCMeansDistributedClusterer;
+import org.apache.ignite.ml.clustering.FuzzyCMeansModel;
+import org.apache.ignite.ml.math.StorageConstants;
+import org.apache.ignite.ml.math.distances.DistanceMeasure;
+import org.apache.ignite.ml.math.distances.EuclideanDistance;
+import org.apache.ignite.ml.math.impls.matrix.SparseDistributedMatrix;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.thread.IgniteThread;
+import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
+import org.apache.ignite.yardstick.ml.DataChanger;
+
+/**
+ * Ignite benchmark that performs ML Grid operations.
+ */
+@SuppressWarnings("unused")
+public class IgniteFuzzyCMeansDistributedClustererBenchmark extends IgniteAbstractBenchmark {
+    /** */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** {@inheritDoc} */
+    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
+        // Create IgniteThread, we must work with SparseDistributedMatrix inside IgniteThread
+        // because we create ignite cache internally.
+        IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(),
+            this.getClass().getSimpleName(), new Runnable() {
+            /** {@inheritDoc} */
+            @Override public void run() {
+                // IMPL NOTE originally taken from FuzzyCMeansExample.
+                // Distance measure that computes distance between two points.
+                DistanceMeasure distanceMeasure = new EuclideanDistance();
+
+                // "Fuzziness" - specific constant that is used in membership calculation (1.0+-eps ~ K-Means).
+                double exponentialWeight = 2.0;
+
+                // Condition that indicated when algorithm must stop.
+                // In this example algorithm stops if memberships have changed insignificantly.
+                BaseFuzzyCMeansClusterer.StopCondition stopCond =
+                    BaseFuzzyCMeansClusterer.StopCondition.STABLE_MEMBERSHIPS;
+
+                // Maximum difference between new and old membership values with which algorithm will continue to work.
+                double maxDelta = 0.01;
+
+                // The maximum number of FCM iterations.
+                int maxIterations = 50;
+
+                // Number of steps of primary centers selection (more steps more candidates).
+                int initializationSteps = 2;
+
+                // Number of K-Means iteration that is used to choose required number of primary centers from candidates.
+                int kMeansMaxIterations = 50;
+
+                // Create new distributed clusterer with parameters described above.
+                FuzzyCMeansDistributedClusterer clusterer = new FuzzyCMeansDistributedClusterer(
+                    distanceMeasure, exponentialWeight, stopCond, maxDelta, maxIterations,
+                    null, initializationSteps, kMeansMaxIterations);
+
+                // Create sample data.
+                double[][] points = shuffle((int)(DataChanger.next()));
+
+                // Initialize matrix of data points. Each row contains one point.
+                int rows = points.length;
+                int cols = points[0].length;
+
+                // Create the matrix that contains sample points.
+                SparseDistributedMatrix pntMatrix = new SparseDistributedMatrix(rows, cols,
+                    StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE);
+
+                // Store points into matrix.
+                pntMatrix.assign(points);
+
+                // Call clusterization method with some number of centers.
+                // It returns model that can predict results for new points.
+                int numCenters = 4;
+                FuzzyCMeansModel mdl = clusterer.cluster(pntMatrix, numCenters);
+
+                // Get centers of clusters that is computed by Fuzzy C-Means algorithm.
+                mdl.centers();
+
+                pntMatrix.destroy();
+            }
+        });
+
+        igniteThread.start();
+
+        igniteThread.join();
+
+        return true;
+    }
+
+    /** */
+    private double[][] shuffle(int off) {
+        final double[][] points = new double[][] {
+            {-10, -10}, {-9, -11}, {-10, -9}, {-11, -9},
+            {10, 10}, {9, 11}, {10, 9}, {11, 9},
+            {-10, 10}, {-9, 11}, {-10, 9}, {-11, 9},
+            {10, -10}, {9, -11}, {10, -9}, {11, -9}};
+
+        final int size = points.length;
+
+        final double[][] res = new double[size][];
+
+        for (int i = 0; i < size; i++)
+            res[i] = points[(i + off) % size];
+
+        return res;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java
new file mode 100644
index 0000000..8c4c9ce
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.yardstick.ml.clustering;
+
+import java.util.Map;
+import org.apache.ignite.ml.clustering.BaseFuzzyCMeansClusterer;
+import org.apache.ignite.ml.clustering.FuzzyCMeansLocalClusterer;
+import org.apache.ignite.ml.clustering.FuzzyCMeansModel;
+import org.apache.ignite.ml.math.distances.DistanceMeasure;
+import org.apache.ignite.ml.math.distances.EuclideanDistance;
+import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix;
+import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
+import org.apache.ignite.yardstick.ml.DataChanger;
+
+/**
+ * Ignite benchmark that performs ML Grid operations.
+ */
+@SuppressWarnings("unused")
+public class IgniteFuzzyCMeansLocalClustererBenchmark extends IgniteAbstractBenchmark {
+    /** {@inheritDoc} */
+    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
+        // IMPL NOTE originally taken from FuzzyLocalCMeansExample.
+        // Distance measure that computes distance between two points.
+        DistanceMeasure distanceMeasure = new EuclideanDistance();
+
+        // "Fuzziness" - specific constant that is used in membership calculation (1.0+-eps ~ K-Means).
+        double exponentialWeight = 2.0;
+
+        // Condition that indicated when algorithm must stop.
+        // In this example algorithm stops if memberships have changed insignificantly.
+        BaseFuzzyCMeansClusterer.StopCondition stopCond =
+            BaseFuzzyCMeansClusterer.StopCondition.STABLE_MEMBERSHIPS;
+
+        // Maximum difference between new and old membership values with which algorithm will continue to work.
+        double maxDelta = 0.01;
+
+        // The maximum number of FCM iterations.
+        int maxIterations = 50;
+
+        // Create new local clusterer with parameters described above.
+        FuzzyCMeansLocalClusterer clusterer = new FuzzyCMeansLocalClusterer(distanceMeasure,
+            exponentialWeight, stopCond, maxDelta, maxIterations, null);
+
+        // Create sample data.
+        double[][] points = shuffle((int)(DataChanger.next()));
+
+        // Create the matrix that contains sample points.
+        DenseLocalOnHeapMatrix pntMatrix = new DenseLocalOnHeapMatrix(points);
+
+        // Call clusterization method with some number of centers.
+        // It returns model that can predict results for new points.
+        int numCenters = 4;
+        FuzzyCMeansModel mdl = clusterer.cluster(pntMatrix, numCenters);
+
+        // Get centers of clusters that is computed by Fuzzy C-Means algorithm.
+        mdl.centers();
+
+        return true;
+    }
+
+    /** */
+    private double[][] shuffle(int off) {
+        final double[][] points = new double[][] {
+            {-10, -10}, {-9, -11}, {-10, -9}, {-11, -9},
+            {10, 10}, {9, 11}, {10, 9}, {11, 9},
+            {-10, 10}, {-9, 11}, {-10, 9}, {-11, 9},
+            {10, -10}, {9, -11}, {10, -9}, {11, -9}};
+
+        final int size = points.length;
+
+        final double[][] res = new double[size][];
+
+        for (int i = 0; i < size; i++)
+            res[i] = points[(i + off) % size];
+
+        return res;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/Datasets.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/Datasets.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/Datasets.java
new file mode 100644
index 0000000..c0191e0
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/Datasets.java
@@ -0,0 +1,453 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.yardstick.ml.knn;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.apache.ignite.ml.math.Vector;
+import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector;
+import org.apache.ignite.ml.structures.LabeledDataset;
+import org.apache.ignite.ml.structures.LabeledVector;
+
+/**
+ * Datasets used in KMeansDistributedClustererExample and in KMeansLocalClustererExample.
+ */
+class Datasets {
+    /**
+     * Generate dataset shuffled as defined in parameter.
+     *
+     * @param off Parameter to use for shuffling raw data.
+     * @return Generated dataset.
+     */
+    LabeledDataset shuffleIris(int off) {
+        return shuffle(off, vectorsIris, labelsIris);
+    }
+
+    /**
+     * Generate dataset shuffled as defined in parameter.
+     *
+     * @param off Parameter to use for shuffling raw data.
+     * @return Generated dataset.
+     */
+    LabeledDataset shuffleClearedMachines(int off) {
+        return shuffle(off, vectorsClearedMachines, labelsClearedMachines);
+    }
+
+    /** */
+    private LabeledDataset shuffle(int off, List<Vector> vectors, List<Double> labels) {
+        int size = vectors.size();
+
+        LabeledVector[] data = new LabeledVector[size];
+        for (int i = 0; i < vectors.size(); i++)
+            data[(i + off) % (size - 1)] = new LabeledVector<>(vectors.get(i), labels.get(i));
+
+        return new LabeledDataset(data, vectors.get(0).size());
+    }
+
+    /** */
+    private final static double[][] dataIris = {
+        new double[] {1.0, 5.1, 3.5, 1.4, 0.2},
+        new double[] {1.0, 4.9, 3.0, 1.4, 0.2},
+        new double[] {1.0, 4.7, 3.2, 1.3, 0.2},
+        new double[] {1.0, 4.6, 3.1, 1.5, 0.2},
+        new double[] {1.0, 5.0, 3.6, 1.4, 0.2},
+        new double[] {1.0, 5.4, 3.9, 1.7, 0.4},
+        new double[] {1.0, 4.6, 3.4, 1.4, 0.3},
+        new double[] {1.0, 5.0, 3.4, 1.5, 0.2},
+        new double[] {1.0, 4.4, 2.9, 1.4, 0.2},
+        new double[] {1.0, 4.9, 3.1, 1.5, 0.1},
+        new double[] {1.0, 5.4, 3.7, 1.5, 0.2},
+        new double[] {1.0, 4.8, 3.4, 1.6, 0.2},
+        new double[] {1.0, 4.8, 3.0, 1.4, 0.1},
+        new double[] {1.0, 4.3, 3.0, 1.1, 0.1},
+        new double[] {1.0, 5.8, 4.0, 1.2, 0.2},
+        new double[] {1.0, 5.7, 4.4, 1.5, 0.4},
+        new double[] {1.0, 5.4, 3.9, 1.3, 0.4},
+        new double[] {1.0, 5.1, 3.5, 1.4, 0.3},
+        new double[] {1.0, 5.7, 3.8, 1.7, 0.3},
+        new double[] {1.0, 5.1, 3.8, 1.5, 0.3},
+        new double[] {1.0, 5.4, 3.4, 1.7, 0.2},
+        new double[] {1.0, 5.1, 3.7, 1.5, 0.4},
+        new double[] {1.0, 4.6, 3.6, 1.0, 0.2},
+        new double[] {1.0, 5.1, 3.3, 1.7, 0.5},
+        new double[] {1.0, 4.8, 3.4, 1.9, 0.2},
+        new double[] {1.0, 5.0, 3.0, 1.6, 0.2},
+        new double[] {1.0, 5.0, 3.4, 1.6, 0.4},
+        new double[] {1.0, 5.2, 3.5, 1.5, 0.2},
+        new double[] {1.0, 5.2, 3.4, 1.4, 0.2},
+        new double[] {1.0, 4.7, 3.2, 1.6, 0.2},
+        new double[] {1.0, 4.8, 3.1, 1.6, 0.2},
+        new double[] {1.0, 5.4, 3.4, 1.5, 0.4},
+        new double[] {1.0, 5.2, 4.1, 1.5, 0.1},
+        new double[] {1.0, 5.5, 4.2, 1.4, 0.2},
+        new double[] {1.0, 4.9, 3.1, 1.5, 0.1},
+        new double[] {1.0, 5.0, 3.2, 1.2, 0.2},
+        new double[] {1.0, 5.5, 3.5, 1.3, 0.2},
+        new double[] {1.0, 4.9, 3.1, 1.5, 0.1},
+        new double[] {1.0, 4.4, 3.0, 1.3, 0.2},
+        new double[] {1.0, 5.1, 3.4, 1.5, 0.2},
+        new double[] {1.0, 5.0, 3.5, 1.3, 0.3},
+        new double[] {1.0, 4.5, 2.3, 1.3, 0.3},
+        new double[] {1.0, 4.4, 3.2, 1.3, 0.2},
+        new double[] {1.0, 5.0, 3.5, 1.6, 0.6},
+        new double[] {1.0, 5.1, 3.8, 1.9, 0.4},
+        new double[] {1.0, 4.8, 3.0, 1.4, 0.3},
+        new double[] {1.0, 5.1, 3.8, 1.6, 0.2},
+        new double[] {1.0, 4.6, 3.2, 1.4, 0.2},
+        new double[] {1.0, 5.3, 3.7, 1.5, 0.2},
+        new double[] {1.0, 5.0, 3.3, 1.4, 0.2},
+        new double[] {2.0, 7.0, 3.2, 4.7, 1.4},
+        new double[] {2.0, 6.4, 3.2, 4.5, 1.5},
+        new double[] {2.0, 6.9, 3.1, 4.9, 1.5},
+        new double[] {2.0, 5.5, 2.3, 4.0, 1.3},
+        new double[] {2.0, 6.5, 2.8, 4.6, 1.5},
+        new double[] {2.0, 5.7, 2.8, 4.5, 1.3},
+        new double[] {2.0, 6.3, 3.3, 4.7, 1.6},
+        new double[] {2.0, 4.9, 2.4, 3.3, 1.0},
+        new double[] {2.0, 6.6, 2.9, 4.6, 1.3},
+        new double[] {2.0, 5.2, 2.7, 3.9, 1.4},
+        new double[] {2.0, 5.0, 2.0, 3.5, 1.0},
+        new double[] {2.0, 5.9, 3.0, 4.2, 1.5},
+        new double[] {2.0, 6.0, 2.2, 4.0, 1.0},
+        new double[] {2.0, 6.1, 2.9, 4.7, 1.4},
+        new double[] {2.0, 5.6, 2.9, 3.6, 1.3},
+        new double[] {2.0, 6.7, 3.1, 4.4, 1.4},
+        new double[] {2.0, 5.6, 3.0, 4.5, 1.5},
+        new double[] {2.0, 5.8, 2.7, 4.1, 1.0},
+        new double[] {2.0, 6.2, 2.2, 4.5, 1.5},
+        new double[] {2.0, 5.6, 2.5, 3.9, 1.1},
+        new double[] {2.0, 5.9, 3.2, 4.8, 1.8},
+        new double[] {2.0, 6.1, 2.8, 4.0, 1.3},
+        new double[] {2.0, 6.3, 2.5, 4.9, 1.5},
+        new double[] {2.0, 6.1, 2.8, 4.7, 1.2},
+        new double[] {2.0, 6.4, 2.9, 4.3, 1.3},
+        new double[] {2.0, 6.6, 3.0, 4.4, 1.4},
+        new double[] {2.0, 6.8, 2.8, 4.8, 1.4},
+        new double[] {2.0, 6.7, 3.0, 5.0, 1.7},
+        new double[] {2.0, 6.0, 2.9, 4.5, 1.5},
+        new double[] {2.0, 5.7, 2.6, 3.5, 1.0},
+        new double[] {2.0, 5.5, 2.4, 3.8, 1.1},
+        new double[] {2.0, 5.5, 2.4, 3.7, 1.0},
+        new double[] {2.0, 5.8, 2.7, 3.9, 1.2},
+        new double[] {2.0, 6.0, 2.7, 5.1, 1.6},
+        new double[] {2.0, 5.4, 3.0, 4.5, 1.5},
+        new double[] {2.0, 6.0, 3.4, 4.5, 1.6},
+        new double[] {2.0, 6.7, 3.1, 4.7, 1.5},
+        new double[] {2.0, 6.3, 2.3, 4.4, 1.3},
+        new double[] {2.0, 5.6, 3.0, 4.1, 1.3},
+        new double[] {2.0, 5.5, 2.5, 4.0, 1.3},
+        new double[] {2.0, 5.5, 2.6, 4.4, 1.2},
+        new double[] {2.0, 6.1, 3.0, 4.6, 1.4},
+        new double[] {2.0, 5.8, 2.6, 4.0, 1.2},
+        new double[] {2.0, 5.0, 2.3, 3.3, 1.0},
+        new double[] {2.0, 5.6, 2.7, 4.2, 1.3},
+        new double[] {2.0, 5.7, 3.0, 4.2, 1.2},
+        new double[] {2.0, 5.7, 2.9, 4.2, 1.3},
+        new double[] {2.0, 6.2, 2.9, 4.3, 1.3},
+        new double[] {2.0, 5.1, 2.5, 3.0, 1.1},
+        new double[] {2.0, 5.7, 2.8, 4.1, 1.3},
+        new double[] {3.0, 6.3, 3.3, 6.0, 2.5},
+        new double[] {3.0, 5.8, 2.7, 5.1, 1.9},
+        new double[] {3.0, 7.1, 3.0, 5.9, 2.1},
+        new double[] {3.0, 6.3, 2.9, 5.6, 1.8},
+        new double[] {3.0, 6.5, 3.0, 5.8, 2.2},
+        new double[] {3.0, 7.6, 3.0, 6.6, 2.1},
+        new double[] {3.0, 4.9, 2.5, 4.5, 1.7},
+        new double[] {3.0, 7.3, 2.9, 6.3, 1.8},
+        new double[] {3.0, 6.7, 2.5, 5.8, 1.8},
+        new double[] {3.0, 7.2, 3.6, 6.1, 2.5},
+        new double[] {3.0, 6.5, 3.2, 5.1, 2.0},
+        new double[] {3.0, 6.4, 2.7, 5.3, 1.9},
+        new double[] {3.0, 6.8, 3.0, 5.5, 2.1},
+        new double[] {3.0, 5.7, 2.5, 5.0, 2.0},
+        new double[] {3.0, 5.8, 2.8, 5.1, 2.4},
+        new double[] {3.0, 6.4, 3.2, 5.3, 2.3},
+        new double[] {3.0, 6.5, 3.0, 5.5, 1.8},
+        new double[] {3.0, 7.7, 3.8, 6.7, 2.2},
+        new double[] {3.0, 7.7, 2.6, 6.9, 2.3},
+        new double[] {3.0, 6.0, 2.2, 5.0, 1.5},
+        new double[] {3.0, 6.9, 3.2, 5.7, 2.3},
+        new double[] {3.0, 5.6, 2.8, 4.9, 2.0},
+        new double[] {3.0, 7.7, 2.8, 6.7, 2.0},
+        new double[] {3.0, 6.3, 2.7, 4.9, 1.8},
+        new double[] {3.0, 6.7, 3.3, 5.7, 2.1},
+        new double[] {3.0, 7.2, 3.2, 6.0, 1.8},
+        new double[] {3.0, 6.2, 2.8, 4.8, 1.8},
+        new double[] {3.0, 6.1, 3.0, 4.9, 1.8},
+        new double[] {3.0, 6.4, 2.8, 5.6, 2.1},
+        new double[] {3.0, 7.2, 3.0, 5.8, 1.6},
+        new double[] {3.0, 7.4, 2.8, 6.1, 1.9},
+        new double[] {3.0, 7.9, 3.8, 6.4, 2.0},
+        new double[] {3.0, 6.4, 2.8, 5.6, 2.2},
+        new double[] {3.0, 6.3, 2.8, 5.1, 1.5},
+        new double[] {3.0, 6.1, 2.6, 5.6, 1.4},
+        new double[] {3.0, 7.7, 3.0, 6.1, 2.3},
+        new double[] {3.0, 6.3, 3.4, 5.6, 2.4},
+        new double[] {3.0, 6.4, 3.1, 5.5, 1.8},
+        new double[] {3.0, 6.0, 3.0, 4.8, 1.8},
+        new double[] {3.0, 6.9, 3.1, 5.4, 2.1},
+        new double[] {3.0, 6.7, 3.1, 5.6, 2.4},
+        new double[] {3.0, 6.9, 3.1, 5.1, 2.3},
+        new double[] {3.0, 5.8, 2.7, 5.1, 1.9},
+        new double[] {3.0, 6.8, 3.2, 5.9, 2.3},
+        new double[] {3.0, 6.7, 3.3, 5.7, 2.5},
+        new double[] {3.0, 6.7, 3.0, 5.2, 2.3},
+        new double[] {3.0, 6.3, 2.5, 5.0, 1.9},
+        new double[] {3.0, 6.5, 3.0, 5.2, 2.0},
+        new double[] {3.0, 6.2, 3.4, 5.4, 2.3},
+        new double[] {3.0, 5.9, 3.0, 5.1, 1.8},
+    };
+
+    /** */
+    private static final List<Double> labelsIris = new ArrayList<>();
+
+    /** */
+    private static final List<Vector> vectorsIris = new ArrayList<>();
+
+    /** */
+    private final static double[][] dataClearedMachines = {
+        new double[] {199,125,256,6000,256,16,128},
+        new double[] {253,29,8000,32000,32,8,32},
+        new double[] {253,29,8000,32000,32,8,32},
+        new double[] {253,29,8000,32000,32,8,32},
+        new double[] {132,29,8000,16000,32,8,16},
+        new double[] {290,26,8000,32000,64,8,32},
+        new double[] {381,23,16000,32000,64,16,32},
+        new double[] {381,23,16000,32000,64,16,32},
+        new double[] {749,23,16000,64000,64,16,32},
+        new double[] {1238,23,32000,64000,128,32,64},
+        new double[] {23,400,1000,3000,0,1,2},
+        new double[] {24,400,512,3500,4,1,6},
+        new double[] {70,60,2000,8000,65,1,8},
+        new double[] {117,50,4000,16000,65,1,8},
+        new double[] {15,350,64,64,0,1,4},
+        new double[] {64,200,512,16000,0,4,32},
+        new double[] {23,167,524,2000,8,4,15},
+        new double[] {29,143,512,5000,0,7,32},
+        new double[] {22,143,1000,2000,0,5,16},
+        new double[] {124,110,5000,5000,142,8,64},
+        new double[] {35,143,1500,6300,0,5,32},
+        new double[] {39,143,3100,6200,0,5,20},
+        new double[] {40,143,2300,6200,0,6,64},
+        new double[] {45,110,3100,6200,0,6,64},
+        new double[] {28,320,128,6000,0,1,12},
+        new double[] {21,320,512,2000,4,1,3},
+        new double[] {28,320,256,6000,0,1,6},
+        new double[] {22,320,256,3000,4,1,3},
+        new double[] {28,320,512,5000,4,1,5},
+        new double[] {27,320,256,5000,4,1,6},
+        new double[] {102,25,1310,2620,131,12,24},
+        new double[] {102,25,1310,2620,131,12,24},
+        new double[] {74,50,2620,10480,30,12,24},
+        new double[] {74,50,2620,10480,30,12,24},
+        new double[] {138,56,5240,20970,30,12,24},
+        new double[] {136,64,5240,20970,30,12,24},
+        new double[] {23,50,500,2000,8,1,4},
+        new double[] {29,50,1000,4000,8,1,5},
+        new double[] {44,50,2000,8000,8,1,5},
+        new double[] {30,50,1000,4000,8,3,5},
+        new double[] {41,50,1000,8000,8,3,5},
+        new double[] {74,50,2000,16000,8,3,5},
+        new double[] {74,50,2000,16000,8,3,6},
+        new double[] {74,50,2000,16000,8,3,6},
+        new double[] {54,133,1000,12000,9,3,12},
+        new double[] {41,133,1000,8000,9,3,12},
+        new double[] {18,810,512,512,8,1,1},
+        new double[] {28,810,1000,5000,0,1,1},
+        new double[] {36,320,512,8000,4,1,5},
+        new double[] {38,200,512,8000,8,1,8},
+        new double[] {34,700,384,8000,0,1,1},
+        new double[] {19,700,256,2000,0,1,1},
+        new double[] {72,140,1000,16000,16,1,3},
+        new double[] {36,200,1000,8000,0,1,2},
+        new double[] {30,110,1000,4000,16,1,2},
+        new double[] {56,110,1000,12000,16,1,2},
+        new double[] {42,220,1000,8000,16,1,2},
+        new double[] {34,800,256,8000,0,1,4},
+        new double[] {34,800,256,8000,0,1,4},
+        new double[] {34,800,256,8000,0,1,4},
+        new double[] {34,800,256,8000,0,1,4},
+        new double[] {34,800,256,8000,0,1,4},
+        new double[] {19,125,512,1000,0,8,20},
+        new double[] {75,75,2000,8000,64,1,38},
+        new double[] {113,75,2000,16000,64,1,38},
+        new double[] {157,75,2000,16000,128,1,38},
+        new double[] {18,90,256,1000,0,3,10},
+        new double[] {20,105,256,2000,0,3,10},
+        new double[] {28,105,1000,4000,0,3,24},
+        new double[] {33,105,2000,4000,8,3,19},
+        new double[] {47,75,2000,8000,8,3,24},
+        new double[] {54,75,3000,8000,8,3,48},
+        new double[] {20,175,256,2000,0,3,24},
+        new double[] {23,300,768,3000,0,6,24},
+        new double[] {25,300,768,3000,6,6,24},
+        new double[] {52,300,768,12000,6,6,24},
+        new double[] {27,300,768,4500,0,1,24},
+        new double[] {50,300,384,12000,6,1,24},
+        new double[] {18,300,192,768,6,6,24},
+        new double[] {53,180,768,12000,6,1,31},
+        new double[] {23,330,1000,3000,0,2,4},
+        new double[] {30,300,1000,4000,8,3,64},
+        new double[] {73,300,1000,16000,8,2,112},
+        new double[] {20,330,1000,2000,0,1,2},
+        new double[] {25,330,1000,4000,0,3,6},
+        new double[] {28,140,2000,4000,0,3,6},
+        new double[] {29,140,2000,4000,0,4,8},
+        new double[] {32,140,2000,4000,8,1,20},
+        new double[] {175,140,2000,32000,32,1,20},
+        new double[] {57,140,2000,8000,32,1,54},
+        new double[] {181,140,2000,32000,32,1,54},
+        new double[] {181,140,2000,32000,32,1,54},
+        new double[] {32,140,2000,4000,8,1,20},
+        new double[] {82,57,4000,16000,1,6,12},
+        new double[] {171,57,4000,24000,64,12,16},
+        new double[] {361,26,16000,32000,64,16,24},
+        new double[] {350,26,16000,32000,64,8,24},
+        new double[] {220,26,8000,32000,0,8,24},
+        new double[] {113,26,8000,16000,0,8,16},
+        new double[] {15,480,96,512,0,1,1},
+        new double[] {21,203,1000,2000,0,1,5},
+        new double[] {35,115,512,6000,16,1,6},
+        new double[] {18,1100,512,1500,0,1,1},
+        new double[] {20,1100,768,2000,0,1,1},
+        new double[] {20,600,768,2000,0,1,1},
+        new double[] {28,400,2000,4000,0,1,1},
+        new double[] {45,400,4000,8000,0,1,1},
+        new double[] {18,900,1000,1000,0,1,2},
+        new double[] {17,900,512,1000,0,1,2},
+        new double[] {26,900,1000,4000,4,1,2},
+        new double[] {28,900,1000,4000,8,1,2},
+        new double[] {28,900,2000,4000,0,3,6},
+        new double[] {31,225,2000,4000,8,3,6},
+        new double[] {31,225,2000,4000,8,3,6},
+        new double[] {42,180,2000,8000,8,1,6},
+        new double[] {76,185,2000,16000,16,1,6},
+        new double[] {76,180,2000,16000,16,1,6},
+        new double[] {26,225,1000,4000,2,3,6},
+        new double[] {59,25,2000,12000,8,1,4},
+        new double[] {65,25,2000,12000,16,3,5},
+        new double[] {101,17,4000,16000,8,6,12},
+        new double[] {116,17,4000,16000,32,6,12},
+        new double[] {18,1500,768,1000,0,0,0},
+        new double[] {20,1500,768,2000,0,0,0},
+        new double[] {20,800,768,2000,0,0,0},
+        new double[] {30,50,2000,4000,0,3,6},
+        new double[] {44,50,2000,8000,8,3,6},
+        new double[] {44,50,2000,8000,8,1,6},
+        new double[] {82,50,2000,16000,24,1,6},
+        new double[] {82,50,2000,16000,24,1,6},
+        new double[] {128,50,8000,16000,48,1,10},
+        new double[] {37,100,1000,8000,0,2,6},
+        new double[] {46,100,1000,8000,24,2,6},
+        new double[] {46,100,1000,8000,24,3,6},
+        new double[] {80,50,2000,16000,12,3,16},
+        new double[] {88,50,2000,16000,24,6,16},
+        new double[] {88,50,2000,16000,24,6,16},
+        new double[] {33,150,512,4000,0,8,128},
+        new double[] {46,115,2000,8000,16,1,3},
+        new double[] {29,115,2000,4000,2,1,5},
+        new double[] {53,92,2000,8000,32,1,6},
+        new double[] {53,92,2000,8000,32,1,6},
+        new double[] {41,92,2000,8000,4,1,6},
+        new double[] {86,75,4000,16000,16,1,6},
+        new double[] {95,60,4000,16000,32,1,6},
+        new double[] {107,60,2000,16000,64,5,8},
+        new double[] {117,60,4000,16000,64,5,8},
+        new double[] {119,50,4000,16000,64,5,10},
+        new double[] {120,72,4000,16000,64,8,16},
+        new double[] {48,72,2000,8000,16,6,8},
+        new double[] {126,40,8000,16000,32,8,16},
+        new double[] {266,40,8000,32000,64,8,24},
+        new double[] {270,35,8000,32000,64,8,24},
+        new double[] {426,38,16000,32000,128,16,32},
+        new double[] {151,48,4000,24000,32,8,24},
+        new double[] {267,38,8000,32000,64,8,24},
+        new double[] {603,30,16000,32000,256,16,24},
+        new double[] {19,112,1000,1000,0,1,4},
+        new double[] {21,84,1000,2000,0,1,6},
+        new double[] {26,56,1000,4000,0,1,6},
+        new double[] {35,56,2000,6000,0,1,8},
+        new double[] {41,56,2000,8000,0,1,8},
+        new double[] {47,56,4000,8000,0,1,8},
+        new double[] {62,56,4000,12000,0,1,8},
+        new double[] {78,56,4000,16000,0,1,8},
+        new double[] {80,38,4000,8000,32,16,32},
+        new double[] {80,38,4000,8000,32,16,32},
+        new double[] {142,38,8000,16000,64,4,8},
+        new double[] {281,38,8000,24000,160,4,8},
+        new double[] {190,38,4000,16000,128,16,32},
+        new double[] {21,200,1000,2000,0,1,2},
+        new double[] {25,200,1000,4000,0,1,4},
+        new double[] {67,200,2000,8000,64,1,5},
+        new double[] {24,250,512,4000,0,1,7},
+        new double[] {24,250,512,4000,0,4,7},
+        new double[] {64,250,1000,16000,1,1,8},
+        new double[] {25,160,512,4000,2,1,5},
+        new double[] {20,160,512,2000,2,3,8},
+        new double[] {29,160,1000,4000,8,1,14},
+        new double[] {43,160,1000,8000,16,1,14},
+        new double[] {53,160,2000,8000,32,1,13},
+        new double[] {19,240,512,1000,8,1,3},
+        new double[] {22,240,512,2000,8,1,5},
+        new double[] {31,105,2000,4000,8,3,8},
+        new double[] {41,105,2000,6000,16,6,16},
+        new double[] {47,105,2000,8000,16,4,14},
+        new double[] {99,52,4000,16000,32,4,12},
+        new double[] {67,70,4000,12000,8,6,8},
+        new double[] {81,59,4000,12000,32,6,12},
+        new double[] {149,59,8000,16000,64,12,24},
+        new double[] {183,26,8000,24000,32,8,16},
+        new double[] {275,26,8000,32000,64,12,16},
+        new double[] {382,26,8000,32000,128,24,32},
+        new double[] {56,116,2000,8000,32,5,28},
+        new double[] {182,50,2000,32000,24,6,26},
+        new double[] {227,50,2000,32000,48,26,52},
+        new double[] {341,50,2000,32000,112,52,104},
+        new double[] {360,50,4000,32000,112,52,104},
+        new double[] {919,30,8000,64000,96,12,176},
+        new double[] {978,30,8000,64000,128,12,176},
+        new double[] {24,180,262,4000,0,1,3},
+        new double[] {24,180,512,4000,0,1,3},
+        new double[] {24,180,262,4000,0,1,3},
+        new double[] {24,180,512,4000,0,1,3},
+        new double[] {37,124,1000,8000,0,1,8},
+        new double[] {50,98,1000,8000,32,2,8},
+        new double[] {41,125,2000,8000,0,2,14},
+        new double[] {47,480,512,8000,32,0,0},
+        new double[] {25,480,1000,4000,0,0,0},
+    };
+
+    /** */
+    private static final List<Double> labelsClearedMachines = new ArrayList<>();
+
+    /** */
+    private static final List<Vector> vectorsClearedMachines = new ArrayList<>();
+
+    static {
+        Arrays.stream(dataIris).forEach(e -> {
+            labelsIris.add(e[0]);
+            vectorsIris.add(new DenseLocalOnHeapVector(new double[] {e[1], e[2], e[3], e[4]}));
+        });
+
+        Arrays.stream(dataClearedMachines).forEach(e -> {
+            labelsClearedMachines.add(e[0]);
+            vectorsClearedMachines.add(new DenseLocalOnHeapVector(new double[] {e[1], e[2], e[3], e[4]}));
+        });
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNClassificationBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNClassificationBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNClassificationBenchmark.java
new file mode 100644
index 0000000..53c73cf
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNClassificationBenchmark.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.yardstick.ml.knn;
+
+import java.util.Map;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.ml.knn.models.KNNModel;
+import org.apache.ignite.ml.knn.models.KNNStrategy;
+import org.apache.ignite.ml.math.distances.EuclideanDistance;
+import org.apache.ignite.ml.structures.LabeledDataset;
+import org.apache.ignite.ml.structures.LabeledDatasetTestTrainPair;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.thread.IgniteThread;
+import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
+import org.apache.ignite.yardstick.ml.DataChanger;
+
+/**
+ * Ignite benchmark that performs ML Grid operations.
+ */
+@SuppressWarnings("unused")
+public class IgniteKNNClassificationBenchmark extends IgniteAbstractBenchmark {
+    /** */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** {@inheritDoc} */
+    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
+        // Create IgniteThread, we must work with SparseDistributedMatrix inside IgniteThread
+        // because we create ignite cache internally.
+        IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(),
+            this.getClass().getSimpleName(), new Runnable() {
+            /** {@inheritDoc} */
+            @Override public void run() {
+                // IMPL NOTE originally taken from KNNClassificationExample.
+                // Obtain shuffled dataset.
+                LabeledDataset dataset = new Datasets().shuffleIris((int)(DataChanger.next()));
+
+                // Random splitting of iris data as 70% train and 30% test datasets.
+                LabeledDatasetTestTrainPair split = new LabeledDatasetTestTrainPair(dataset, 0.3);
+
+                LabeledDataset test = split.test();
+                LabeledDataset train = split.train();
+
+                KNNModel knnMdl = new KNNModel(5, new EuclideanDistance(), KNNStrategy.SIMPLE, train);
+
+                // Calculate predicted classes.
+                for (int i = 0; i < test.rowSize() - 1; i++)
+                    knnMdl.apply(test.getRow(i).features());
+            }
+        });
+
+        igniteThread.start();
+
+        igniteThread.join();
+
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNRegressionBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNRegressionBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNRegressionBenchmark.java
new file mode 100644
index 0000000..75242e6
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/IgniteKNNRegressionBenchmark.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.yardstick.ml.knn;
+
+import java.util.Map;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.ml.knn.models.KNNModel;
+import org.apache.ignite.ml.knn.models.KNNStrategy;
+import org.apache.ignite.ml.knn.regression.KNNMultipleLinearRegression;
+import org.apache.ignite.ml.math.distances.ManhattanDistance;
+import org.apache.ignite.ml.structures.LabeledDataset;
+import org.apache.ignite.ml.structures.LabeledDatasetTestTrainPair;
+import org.apache.ignite.ml.structures.preprocessing.Normalizer;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.thread.IgniteThread;
+import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
+import org.apache.ignite.yardstick.ml.DataChanger;
+
+/**
+ * Ignite benchmark that performs ML Grid operations.
+ */
+@SuppressWarnings("unused")
+public class IgniteKNNRegressionBenchmark extends IgniteAbstractBenchmark {
+    /** */
+    @IgniteInstanceResource
+    private Ignite ignite;
+
+    /** {@inheritDoc} */
+    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
+        // Create IgniteThread, we must work with SparseDistributedMatrix inside IgniteThread
+        // because we create ignite cache internally.
+        IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(),
+            this.getClass().getSimpleName(), new Runnable() {
+            /** {@inheritDoc} */
+            @Override public void run() {
+                // IMPL NOTE originally taken from KNNRegressionExample.
+                // Obtain shuffled dataset.
+                LabeledDataset dataset = new Datasets().shuffleClearedMachines((int)(DataChanger.next()));
+
+                // Normalize dataset
+                Normalizer.normalizeWithMiniMax(dataset);
+
+                // Random splitting of iris data as 80% train and 20% test datasets.
+                LabeledDatasetTestTrainPair split = new LabeledDatasetTestTrainPair(dataset, 0.2);
+
+                LabeledDataset test = split.test();
+                LabeledDataset train = split.train();
+
+                // Builds weighted kNN-regression with Manhattan Distance.
+                KNNModel knnMdl = new KNNMultipleLinearRegression(7, new ManhattanDistance(), KNNStrategy.WEIGHTED, train);
+
+                // Clone labels
+                final double[] labels = test.labels();
+
+                // Calculate predicted classes.
+                for (int i = 0; i < test.rowSize() - 1; i++)
+                    knnMdl.apply(test.getRow(i).features());
+            }
+        });
+
+        igniteThread.start();
+
+        igniteThread.join();
+
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/package-info.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/package-info.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/package-info.java
new file mode 100644
index 0000000..a5ff26a
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/knn/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * <!-- Package description. -->
+ * ML Grid kNN benchmarks.
+ */
+package org.apache.ignite.yardstick.ml.knn;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/math/IgniteSparseDistributedMatrixMul2Benchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/math/IgniteSparseDistributedMatrixMul2Benchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/math/IgniteSparseDistributedMatrixMul2Benchmark.java
new file mode 100644
index 0000000..e1afc34
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/ml/math/IgniteSparseDistributedMatrixMul2Benchmark.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.yardstick.ml.math;
+
+import org.apache.ignite.ml.math.Matrix;
+import org.apache.ignite.ml.math.StorageConstants;
+import org.apache.ignite.ml.math.impls.matrix.SparseBlockDistributedMatrix;
+import org.apache.ignite.ml.math.impls.matrix.SparseDistributedMatrix;
+
+/**
+ * Ignite benchmark that performs trivially optimized matrix multiplication of {@link SparseDistributedMatrix} that
+ * uses delegating to {@link SparseBlockDistributedMatrix}. For unoptimized benchmark refer
+ * {@link IgniteSparseDistributedMatrixMulBenchmark}.
+ */
+@SuppressWarnings("unused")
+public class IgniteSparseDistributedMatrixMul2Benchmark extends IgniteAbstractMatrixMulBenchmark {
+    /** {@inheritDoc} */
+    @Override Matrix newMatrix(int rowSize, int colSize) {
+        return new SparseDistributedMatrix(rowSize, colSize,
+            StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE);
+    }
+
+    /** {@inheritDoc} */
+    @Override public Matrix times(Matrix m1, Matrix m2) {
+        return new OptimisedTimes(m1, m2).times();
+    }
+
+    /** */
+    private static class OptimisedTimes {
+        /** */
+        private final Matrix m1;
+
+        /** */
+        private final Matrix m2;
+
+        /** */
+        OptimisedTimes(Matrix m1, Matrix m2) {
+            this.m1 = m1;
+            this.m2 = m2;
+        }
+
+        /** */
+        Matrix times() {
+            Matrix m1Block = new SparseBlockDistributedMatrix(m1.rowSize(), m1.columnSize()).assign(m1);
+            Matrix m2Block = new SparseBlockDistributedMatrix(m2.rowSize(), m2.columnSize()).assign(m2);
+
+            Matrix m3Block = m1Block.times(m2Block);
+
+            Matrix res = new SparseDistributedMatrix(m3Block.rowSize(), m3Block.columnSize(),
+                StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE).assign(m3Block);
+
+            m1Block.destroy();
+            m2Block.destroy();
+            m3Block.destroy();
+
+            return res;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java b/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java
deleted file mode 100644
index e356746..0000000
--- a/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansDistributedClustererBenchmark.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.yardstick.ml.clustering;
-
-import java.util.Map;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.ml.clustering.BaseFuzzyCMeansClusterer;
-import org.apache.ignite.ml.clustering.FuzzyCMeansDistributedClusterer;
-import org.apache.ignite.ml.clustering.FuzzyCMeansModel;
-import org.apache.ignite.ml.math.StorageConstants;
-import org.apache.ignite.ml.math.distances.DistanceMeasure;
-import org.apache.ignite.ml.math.distances.EuclideanDistance;
-import org.apache.ignite.ml.math.impls.matrix.SparseDistributedMatrix;
-import org.apache.ignite.resources.IgniteInstanceResource;
-import org.apache.ignite.thread.IgniteThread;
-import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
-import org.apache.ignite.yardstick.ml.DataChanger;
-
-/**
- * Ignite benchmark that performs ML Grid operations.
- */
-@SuppressWarnings("unused")
-public class IgniteFuzzyCMeansDistributedClustererBenchmark extends IgniteAbstractBenchmark {
-    /** */
-    @IgniteInstanceResource
-    private Ignite ignite;
-
-    /** {@inheritDoc} */
-    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
-        // Create IgniteThread, we must work with SparseDistributedMatrix inside IgniteThread
-        // because we create ignite cache internally.
-        IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(),
-            this.getClass().getSimpleName(), new Runnable() {
-            /** {@inheritDoc} */
-            @Override public void run() {
-                // IMPL NOTE originally taken from FuzzyCMeansExample.
-                // Distance measure that computes distance between two points.
-                DistanceMeasure distanceMeasure = new EuclideanDistance();
-
-                // "Fuzziness" - specific constant that is used in membership calculation (1.0+-eps ~ K-Means).
-                double exponentialWeight = 2.0;
-
-                // Condition that indicated when algorithm must stop.
-                // In this example algorithm stops if memberships have changed insignificantly.
-                BaseFuzzyCMeansClusterer.StopCondition stopCond =
-                    BaseFuzzyCMeansClusterer.StopCondition.STABLE_MEMBERSHIPS;
-
-                // Maximum difference between new and old membership values with which algorithm will continue to work.
-                double maxDelta = 0.01;
-
-                // The maximum number of FCM iterations.
-                int maxIterations = 50;
-
-                // Number of steps of primary centers selection (more steps more candidates).
-                int initializationSteps = 2;
-
-                // Number of K-Means iteration that is used to choose required number of primary centers from candidates.
-                int kMeansMaxIterations = 50;
-
-                // Create new distributed clusterer with parameters described above.
-                FuzzyCMeansDistributedClusterer clusterer = new FuzzyCMeansDistributedClusterer(
-                    distanceMeasure, exponentialWeight, stopCond, maxDelta, maxIterations,
-                    null, initializationSteps, kMeansMaxIterations);
-
-                // Create sample data.
-                double[][] points = shuffle((int)(DataChanger.next()));
-
-                // Initialize matrix of data points. Each row contains one point.
-                int rows = points.length;
-                int cols = points[0].length;
-
-                // Create the matrix that contains sample points.
-                SparseDistributedMatrix pntMatrix = new SparseDistributedMatrix(rows, cols,
-                    StorageConstants.ROW_STORAGE_MODE, StorageConstants.RANDOM_ACCESS_MODE);
-
-                // Store points into matrix.
-                pntMatrix.assign(points);
-
-                // Call clusterization method with some number of centers.
-                // It returns model that can predict results for new points.
-                int numCenters = 4;
-                FuzzyCMeansModel mdl = clusterer.cluster(pntMatrix, numCenters);
-
-                // Get centers of clusters that is computed by Fuzzy C-Means algorithm.
-                mdl.centers();
-
-                pntMatrix.destroy();
-            }
-        });
-
-        igniteThread.start();
-
-        igniteThread.join();
-
-        return true;
-    }
-
-    /** */
-    private double[][] shuffle(int off) {
-        final double[][] points = new double[][] {
-            {-10, -10}, {-9, -11}, {-10, -9}, {-11, -9},
-            {10, 10}, {9, 11}, {10, 9}, {11, 9},
-            {-10, 10}, {-9, 11}, {-10, 9}, {-11, 9},
-            {10, -10}, {9, -11}, {10, -9}, {11, -9}};
-
-        final int size = points.length;
-
-        final double[][] res = new double[size][];
-
-        for (int i = 0; i < size; i++)
-            res[i] = points[(i + off) % size];
-
-        return res;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java b/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java
deleted file mode 100644
index 8c4c9ce..0000000
--- a/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/clustering/IgniteFuzzyCMeansLocalClustererBenchmark.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.yardstick.ml.clustering;
-
-import java.util.Map;
-import org.apache.ignite.ml.clustering.BaseFuzzyCMeansClusterer;
-import org.apache.ignite.ml.clustering.FuzzyCMeansLocalClusterer;
-import org.apache.ignite.ml.clustering.FuzzyCMeansModel;
-import org.apache.ignite.ml.math.distances.DistanceMeasure;
-import org.apache.ignite.ml.math.distances.EuclideanDistance;
-import org.apache.ignite.ml.math.impls.matrix.DenseLocalOnHeapMatrix;
-import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
-import org.apache.ignite.yardstick.ml.DataChanger;
-
-/**
- * Ignite benchmark that performs ML Grid operations.
- */
-@SuppressWarnings("unused")
-public class IgniteFuzzyCMeansLocalClustererBenchmark extends IgniteAbstractBenchmark {
-    /** {@inheritDoc} */
-    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
-        // IMPL NOTE originally taken from FuzzyLocalCMeansExample.
-        // Distance measure that computes distance between two points.
-        DistanceMeasure distanceMeasure = new EuclideanDistance();
-
-        // "Fuzziness" - specific constant that is used in membership calculation (1.0+-eps ~ K-Means).
-        double exponentialWeight = 2.0;
-
-        // Condition that indicated when algorithm must stop.
-        // In this example algorithm stops if memberships have changed insignificantly.
-        BaseFuzzyCMeansClusterer.StopCondition stopCond =
-            BaseFuzzyCMeansClusterer.StopCondition.STABLE_MEMBERSHIPS;
-
-        // Maximum difference between new and old membership values with which algorithm will continue to work.
-        double maxDelta = 0.01;
-
-        // The maximum number of FCM iterations.
-        int maxIterations = 50;
-
-        // Create new local clusterer with parameters described above.
-        FuzzyCMeansLocalClusterer clusterer = new FuzzyCMeansLocalClusterer(distanceMeasure,
-            exponentialWeight, stopCond, maxDelta, maxIterations, null);
-
-        // Create sample data.
-        double[][] points = shuffle((int)(DataChanger.next()));
-
-        // Create the matrix that contains sample points.
-        DenseLocalOnHeapMatrix pntMatrix = new DenseLocalOnHeapMatrix(points);
-
-        // Call clusterization method with some number of centers.
-        // It returns model that can predict results for new points.
-        int numCenters = 4;
-        FuzzyCMeansModel mdl = clusterer.cluster(pntMatrix, numCenters);
-
-        // Get centers of clusters that is computed by Fuzzy C-Means algorithm.
-        mdl.centers();
-
-        return true;
-    }
-
-    /** */
-    private double[][] shuffle(int off) {
-        final double[][] points = new double[][] {
-            {-10, -10}, {-9, -11}, {-10, -9}, {-11, -9},
-            {10, 10}, {9, 11}, {10, 9}, {11, 9},
-            {-10, 10}, {-9, 11}, {-10, 9}, {-11, 9},
-            {10, -10}, {9, -11}, {10, -9}, {11, -9}};
-
-        final int size = points.length;
-
-        final double[][] res = new double[size][];
-
-        for (int i = 0; i < size; i++)
-            res[i] = points[(i + off) % size];
-
-        return res;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/cb1233a0/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/knn/Datasets.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/knn/Datasets.java b/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/knn/Datasets.java
deleted file mode 100644
index c0191e0..0000000
--- a/modules/yardstick/src/main/ml/org/apache/ignite/yardstick/ml/knn/Datasets.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.yardstick.ml.knn;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.apache.ignite.ml.math.Vector;
-import org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector;
-import org.apache.ignite.ml.structures.LabeledDataset;
-import org.apache.ignite.ml.structures.LabeledVector;
-
-/**
- * Datasets used in KMeansDistributedClustererExample and in KMeansLocalClustererExample.
- */
-class Datasets {
-    /**
-     * Generate dataset shuffled as defined in parameter.
-     *
-     * @param off Parameter to use for shuffling raw data.
-     * @return Generated dataset.
-     */
-    LabeledDataset shuffleIris(int off) {
-        return shuffle(off, vectorsIris, labelsIris);
-    }
-
-    /**
-     * Generate dataset shuffled as defined in parameter.
-     *
-     * @param off Parameter to use for shuffling raw data.
-     * @return Generated dataset.
-     */
-    LabeledDataset shuffleClearedMachines(int off) {
-        return shuffle(off, vectorsClearedMachines, labelsClearedMachines);
-    }
-
-    /** */
-    private LabeledDataset shuffle(int off, List<Vector> vectors, List<Double> labels) {
-        int size = vectors.size();
-
-        LabeledVector[] data = new LabeledVector[size];
-        for (int i = 0; i < vectors.size(); i++)
-            data[(i + off) % (size - 1)] = new LabeledVector<>(vectors.get(i), labels.get(i));
-
-        return new LabeledDataset(data, vectors.get(0).size());
-    }
-
-    /** */
-    private final static double[][] dataIris = {
-        new double[] {1.0, 5.1, 3.5, 1.4, 0.2},
-        new double[] {1.0, 4.9, 3.0, 1.4, 0.2},
-        new double[] {1.0, 4.7, 3.2, 1.3, 0.2},
-        new double[] {1.0, 4.6, 3.1, 1.5, 0.2},
-        new double[] {1.0, 5.0, 3.6, 1.4, 0.2},
-        new double[] {1.0, 5.4, 3.9, 1.7, 0.4},
-        new double[] {1.0, 4.6, 3.4, 1.4, 0.3},
-        new double[] {1.0, 5.0, 3.4, 1.5, 0.2},
-        new double[] {1.0, 4.4, 2.9, 1.4, 0.2},
-        new double[] {1.0, 4.9, 3.1, 1.5, 0.1},
-        new double[] {1.0, 5.4, 3.7, 1.5, 0.2},
-        new double[] {1.0, 4.8, 3.4, 1.6, 0.2},
-        new double[] {1.0, 4.8, 3.0, 1.4, 0.1},
-        new double[] {1.0, 4.3, 3.0, 1.1, 0.1},
-        new double[] {1.0, 5.8, 4.0, 1.2, 0.2},
-        new double[] {1.0, 5.7, 4.4, 1.5, 0.4},
-        new double[] {1.0, 5.4, 3.9, 1.3, 0.4},
-        new double[] {1.0, 5.1, 3.5, 1.4, 0.3},
-        new double[] {1.0, 5.7, 3.8, 1.7, 0.3},
-        new double[] {1.0, 5.1, 3.8, 1.5, 0.3},
-        new double[] {1.0, 5.4, 3.4, 1.7, 0.2},
-        new double[] {1.0, 5.1, 3.7, 1.5, 0.4},
-        new double[] {1.0, 4.6, 3.6, 1.0, 0.2},
-        new double[] {1.0, 5.1, 3.3, 1.7, 0.5},
-        new double[] {1.0, 4.8, 3.4, 1.9, 0.2},
-        new double[] {1.0, 5.0, 3.0, 1.6, 0.2},
-        new double[] {1.0, 5.0, 3.4, 1.6, 0.4},
-        new double[] {1.0, 5.2, 3.5, 1.5, 0.2},
-        new double[] {1.0, 5.2, 3.4, 1.4, 0.2},
-        new double[] {1.0, 4.7, 3.2, 1.6, 0.2},
-        new double[] {1.0, 4.8, 3.1, 1.6, 0.2},
-        new double[] {1.0, 5.4, 3.4, 1.5, 0.4},
-        new double[] {1.0, 5.2, 4.1, 1.5, 0.1},
-        new double[] {1.0, 5.5, 4.2, 1.4, 0.2},
-        new double[] {1.0, 4.9, 3.1, 1.5, 0.1},
-        new double[] {1.0, 5.0, 3.2, 1.2, 0.2},
-        new double[] {1.0, 5.5, 3.5, 1.3, 0.2},
-        new double[] {1.0, 4.9, 3.1, 1.5, 0.1},
-        new double[] {1.0, 4.4, 3.0, 1.3, 0.2},
-        new double[] {1.0, 5.1, 3.4, 1.5, 0.2},
-        new double[] {1.0, 5.0, 3.5, 1.3, 0.3},
-        new double[] {1.0, 4.5, 2.3, 1.3, 0.3},
-        new double[] {1.0, 4.4, 3.2, 1.3, 0.2},
-        new double[] {1.0, 5.0, 3.5, 1.6, 0.6},
-        new double[] {1.0, 5.1, 3.8, 1.9, 0.4},
-        new double[] {1.0, 4.8, 3.0, 1.4, 0.3},
-        new double[] {1.0, 5.1, 3.8, 1.6, 0.2},
-        new double[] {1.0, 4.6, 3.2, 1.4, 0.2},
-        new double[] {1.0, 5.3, 3.7, 1.5, 0.2},
-        new double[] {1.0, 5.0, 3.3, 1.4, 0.2},
-        new double[] {2.0, 7.0, 3.2, 4.7, 1.4},
-        new double[] {2.0, 6.4, 3.2, 4.5, 1.5},
-        new double[] {2.0, 6.9, 3.1, 4.9, 1.5},
-        new double[] {2.0, 5.5, 2.3, 4.0, 1.3},
-        new double[] {2.0, 6.5, 2.8, 4.6, 1.5},
-        new double[] {2.0, 5.7, 2.8, 4.5, 1.3},
-        new double[] {2.0, 6.3, 3.3, 4.7, 1.6},
-        new double[] {2.0, 4.9, 2.4, 3.3, 1.0},
-        new double[] {2.0, 6.6, 2.9, 4.6, 1.3},
-        new double[] {2.0, 5.2, 2.7, 3.9, 1.4},
-        new double[] {2.0, 5.0, 2.0, 3.5, 1.0},
-        new double[] {2.0, 5.9, 3.0, 4.2, 1.5},
-        new double[] {2.0, 6.0, 2.2, 4.0, 1.0},
-        new double[] {2.0, 6.1, 2.9, 4.7, 1.4},
-        new double[] {2.0, 5.6, 2.9, 3.6, 1.3},
-        new double[] {2.0, 6.7, 3.1, 4.4, 1.4},
-        new double[] {2.0, 5.6, 3.0, 4.5, 1.5},
-        new double[] {2.0, 5.8, 2.7, 4.1, 1.0},
-        new double[] {2.0, 6.2, 2.2, 4.5, 1.5},
-        new double[] {2.0, 5.6, 2.5, 3.9, 1.1},
-        new double[] {2.0, 5.9, 3.2, 4.8, 1.8},
-        new double[] {2.0, 6.1, 2.8, 4.0, 1.3},
-        new double[] {2.0, 6.3, 2.5, 4.9, 1.5},
-        new double[] {2.0, 6.1, 2.8, 4.7, 1.2},
-        new double[] {2.0, 6.4, 2.9, 4.3, 1.3},
-        new double[] {2.0, 6.6, 3.0, 4.4, 1.4},
-        new double[] {2.0, 6.8, 2.8, 4.8, 1.4},
-        new double[] {2.0, 6.7, 3.0, 5.0, 1.7},
-        new double[] {2.0, 6.0, 2.9, 4.5, 1.5},
-        new double[] {2.0, 5.7, 2.6, 3.5, 1.0},
-        new double[] {2.0, 5.5, 2.4, 3.8, 1.1},
-        new double[] {2.0, 5.5, 2.4, 3.7, 1.0},
-        new double[] {2.0, 5.8, 2.7, 3.9, 1.2},
-        new double[] {2.0, 6.0, 2.7, 5.1, 1.6},
-        new double[] {2.0, 5.4, 3.0, 4.5, 1.5},
-        new double[] {2.0, 6.0, 3.4, 4.5, 1.6},
-        new double[] {2.0, 6.7, 3.1, 4.7, 1.5},
-        new double[] {2.0, 6.3, 2.3, 4.4, 1.3},
-        new double[] {2.0, 5.6, 3.0, 4.1, 1.3},
-        new double[] {2.0, 5.5, 2.5, 4.0, 1.3},
-        new double[] {2.0, 5.5, 2.6, 4.4, 1.2},
-        new double[] {2.0, 6.1, 3.0, 4.6, 1.4},
-        new double[] {2.0, 5.8, 2.6, 4.0, 1.2},
-        new double[] {2.0, 5.0, 2.3, 3.3, 1.0},
-        new double[] {2.0, 5.6, 2.7, 4.2, 1.3},
-        new double[] {2.0, 5.7, 3.0, 4.2, 1.2},
-        new double[] {2.0, 5.7, 2.9, 4.2, 1.3},
-        new double[] {2.0, 6.2, 2.9, 4.3, 1.3},
-        new double[] {2.0, 5.1, 2.5, 3.0, 1.1},
-        new double[] {2.0, 5.7, 2.8, 4.1, 1.3},
-        new double[] {3.0, 6.3, 3.3, 6.0, 2.5},
-        new double[] {3.0, 5.8, 2.7, 5.1, 1.9},
-        new double[] {3.0, 7.1, 3.0, 5.9, 2.1},
-        new double[] {3.0, 6.3, 2.9, 5.6, 1.8},
-        new double[] {3.0, 6.5, 3.0, 5.8, 2.2},
-        new double[] {3.0, 7.6, 3.0, 6.6, 2.1},
-        new double[] {3.0, 4.9, 2.5, 4.5, 1.7},
-        new double[] {3.0, 7.3, 2.9, 6.3, 1.8},
-        new double[] {3.0, 6.7, 2.5, 5.8, 1.8},
-        new double[] {3.0, 7.2, 3.6, 6.1, 2.5},
-        new double[] {3.0, 6.5, 3.2, 5.1, 2.0},
-        new double[] {3.0, 6.4, 2.7, 5.3, 1.9},
-        new double[] {3.0, 6.8, 3.0, 5.5, 2.1},
-        new double[] {3.0, 5.7, 2.5, 5.0, 2.0},
-        new double[] {3.0, 5.8, 2.8, 5.1, 2.4},
-        new double[] {3.0, 6.4, 3.2, 5.3, 2.3},
-        new double[] {3.0, 6.5, 3.0, 5.5, 1.8},
-        new double[] {3.0, 7.7, 3.8, 6.7, 2.2},
-        new double[] {3.0, 7.7, 2.6, 6.9, 2.3},
-        new double[] {3.0, 6.0, 2.2, 5.0, 1.5},
-        new double[] {3.0, 6.9, 3.2, 5.7, 2.3},
-        new double[] {3.0, 5.6, 2.8, 4.9, 2.0},
-        new double[] {3.0, 7.7, 2.8, 6.7, 2.0},
-        new double[] {3.0, 6.3, 2.7, 4.9, 1.8},
-        new double[] {3.0, 6.7, 3.3, 5.7, 2.1},
-        new double[] {3.0, 7.2, 3.2, 6.0, 1.8},
-        new double[] {3.0, 6.2, 2.8, 4.8, 1.8},
-        new double[] {3.0, 6.1, 3.0, 4.9, 1.8},
-        new double[] {3.0, 6.4, 2.8, 5.6, 2.1},
-        new double[] {3.0, 7.2, 3.0, 5.8, 1.6},
-        new double[] {3.0, 7.4, 2.8, 6.1, 1.9},
-        new double[] {3.0, 7.9, 3.8, 6.4, 2.0},
-        new double[] {3.0, 6.4, 2.8, 5.6, 2.2},
-        new double[] {3.0, 6.3, 2.8, 5.1, 1.5},
-        new double[] {3.0, 6.1, 2.6, 5.6, 1.4},
-        new double[] {3.0, 7.7, 3.0, 6.1, 2.3},
-        new double[] {3.0, 6.3, 3.4, 5.6, 2.4},
-        new double[] {3.0, 6.4, 3.1, 5.5, 1.8},
-        new double[] {3.0, 6.0, 3.0, 4.8, 1.8},
-        new double[] {3.0, 6.9, 3.1, 5.4, 2.1},
-        new double[] {3.0, 6.7, 3.1, 5.6, 2.4},
-        new double[] {3.0, 6.9, 3.1, 5.1, 2.3},
-        new double[] {3.0, 5.8, 2.7, 5.1, 1.9},
-        new double[] {3.0, 6.8, 3.2, 5.9, 2.3},
-        new double[] {3.0, 6.7, 3.3, 5.7, 2.5},
-        new double[] {3.0, 6.7, 3.0, 5.2, 2.3},
-        new double[] {3.0, 6.3, 2.5, 5.0, 1.9},
-        new double[] {3.0, 6.5, 3.0, 5.2, 2.0},
-        new double[] {3.0, 6.2, 3.4, 5.4, 2.3},
-        new double[] {3.0, 5.9, 3.0, 5.1, 1.8},
-    };
-
-    /** */
-    private static final List<Double> labelsIris = new ArrayList<>();
-
-    /** */
-    private static final List<Vector> vectorsIris = new ArrayList<>();
-
-    /** */
-    private final static double[][] dataClearedMachines = {
-        new double[] {199,125,256,6000,256,16,128},
-        new double[] {253,29,8000,32000,32,8,32},
-        new double[] {253,29,8000,32000,32,8,32},
-        new double[] {253,29,8000,32000,32,8,32},
-        new double[] {132,29,8000,16000,32,8,16},
-        new double[] {290,26,8000,32000,64,8,32},
-        new double[] {381,23,16000,32000,64,16,32},
-        new double[] {381,23,16000,32000,64,16,32},
-        new double[] {749,23,16000,64000,64,16,32},
-        new double[] {1238,23,32000,64000,128,32,64},
-        new double[] {23,400,1000,3000,0,1,2},
-        new double[] {24,400,512,3500,4,1,6},
-        new double[] {70,60,2000,8000,65,1,8},
-        new double[] {117,50,4000,16000,65,1,8},
-        new double[] {15,350,64,64,0,1,4},
-        new double[] {64,200,512,16000,0,4,32},
-        new double[] {23,167,524,2000,8,4,15},
-        new double[] {29,143,512,5000,0,7,32},
-        new double[] {22,143,1000,2000,0,5,16},
-        new double[] {124,110,5000,5000,142,8,64},
-        new double[] {35,143,1500,6300,0,5,32},
-        new double[] {39,143,3100,6200,0,5,20},
-        new double[] {40,143,2300,6200,0,6,64},
-        new double[] {45,110,3100,6200,0,6,64},
-        new double[] {28,320,128,6000,0,1,12},
-        new double[] {21,320,512,2000,4,1,3},
-        new double[] {28,320,256,6000,0,1,6},
-        new double[] {22,320,256,3000,4,1,3},
-        new double[] {28,320,512,5000,4,1,5},
-        new double[] {27,320,256,5000,4,1,6},
-        new double[] {102,25,1310,2620,131,12,24},
-        new double[] {102,25,1310,2620,131,12,24},
-        new double[] {74,50,2620,10480,30,12,24},
-        new double[] {74,50,2620,10480,30,12,24},
-        new double[] {138,56,5240,20970,30,12,24},
-        new double[] {136,64,5240,20970,30,12,24},
-        new double[] {23,50,500,2000,8,1,4},
-        new double[] {29,50,1000,4000,8,1,5},
-        new double[] {44,50,2000,8000,8,1,5},
-        new double[] {30,50,1000,4000,8,3,5},
-        new double[] {41,50,1000,8000,8,3,5},
-        new double[] {74,50,2000,16000,8,3,5},
-        new double[] {74,50,2000,16000,8,3,6},
-        new double[] {74,50,2000,16000,8,3,6},
-        new double[] {54,133,1000,12000,9,3,12},
-        new double[] {41,133,1000,8000,9,3,12},
-        new double[] {18,810,512,512,8,1,1},
-        new double[] {28,810,1000,5000,0,1,1},
-        new double[] {36,320,512,8000,4,1,5},
-        new double[] {38,200,512,8000,8,1,8},
-        new double[] {34,700,384,8000,0,1,1},
-        new double[] {19,700,256,2000,0,1,1},
-        new double[] {72,140,1000,16000,16,1,3},
-        new double[] {36,200,1000,8000,0,1,2},
-        new double[] {30,110,1000,4000,16,1,2},
-        new double[] {56,110,1000,12000,16,1,2},
-        new double[] {42,220,1000,8000,16,1,2},
-        new double[] {34,800,256,8000,0,1,4},
-        new double[] {34,800,256,8000,0,1,4},
-        new double[] {34,800,256,8000,0,1,4},
-        new double[] {34,800,256,8000,0,1,4},
-        new double[] {34,800,256,8000,0,1,4},
-        new double[] {19,125,512,1000,0,8,20},
-        new double[] {75,75,2000,8000,64,1,38},
-        new double[] {113,75,2000,16000,64,1,38},
-        new double[] {157,75,2000,16000,128,1,38},
-        new double[] {18,90,256,1000,0,3,10},
-        new double[] {20,105,256,2000,0,3,10},
-        new double[] {28,105,1000,4000,0,3,24},
-        new double[] {33,105,2000,4000,8,3,19},
-        new double[] {47,75,2000,8000,8,3,24},
-        new double[] {54,75,3000,8000,8,3,48},
-        new double[] {20,175,256,2000,0,3,24},
-        new double[] {23,300,768,3000,0,6,24},
-        new double[] {25,300,768,3000,6,6,24},
-        new double[] {52,300,768,12000,6,6,24},
-        new double[] {27,300,768,4500,0,1,24},
-        new double[] {50,300,384,12000,6,1,24},
-        new double[] {18,300,192,768,6,6,24},
-        new double[] {53,180,768,12000,6,1,31},
-        new double[] {23,330,1000,3000,0,2,4},
-        new double[] {30,300,1000,4000,8,3,64},
-        new double[] {73,300,1000,16000,8,2,112},
-        new double[] {20,330,1000,2000,0,1,2},
-        new double[] {25,330,1000,4000,0,3,6},
-        new double[] {28,140,2000,4000,0,3,6},
-        new double[] {29,140,2000,4000,0,4,8},
-        new double[] {32,140,2000,4000,8,1,20},
-        new double[] {175,140,2000,32000,32,1,20},
-        new double[] {57,140,2000,8000,32,1,54},
-        new double[] {181,140,2000,32000,32,1,54},
-        new double[] {181,140,2000,32000,32,1,54},
-        new double[] {32,140,2000,4000,8,1,20},
-        new double[] {82,57,4000,16000,1,6,12},
-        new double[] {171,57,4000,24000,64,12,16},
-        new double[] {361,26,16000,32000,64,16,24},
-        new double[] {350,26,16000,32000,64,8,24},
-        new double[] {220,26,8000,32000,0,8,24},
-        new double[] {113,26,8000,16000,0,8,16},
-        new double[] {15,480,96,512,0,1,1},
-        new double[] {21,203,1000,2000,0,1,5},
-        new double[] {35,115,512,6000,16,1,6},
-        new double[] {18,1100,512,1500,0,1,1},
-        new double[] {20,1100,768,2000,0,1,1},
-        new double[] {20,600,768,2000,0,1,1},
-        new double[] {28,400,2000,4000,0,1,1},
-        new double[] {45,400,4000,8000,0,1,1},
-        new double[] {18,900,1000,1000,0,1,2},
-        new double[] {17,900,512,1000,0,1,2},
-        new double[] {26,900,1000,4000,4,1,2},
-        new double[] {28,900,1000,4000,8,1,2},
-        new double[] {28,900,2000,4000,0,3,6},
-        new double[] {31,225,2000,4000,8,3,6},
-        new double[] {31,225,2000,4000,8,3,6},
-        new double[] {42,180,2000,8000,8,1,6},
-        new double[] {76,185,2000,16000,16,1,6},
-        new double[] {76,180,2000,16000,16,1,6},
-        new double[] {26,225,1000,4000,2,3,6},
-        new double[] {59,25,2000,12000,8,1,4},
-        new double[] {65,25,2000,12000,16,3,5},
-        new double[] {101,17,4000,16000,8,6,12},
-        new double[] {116,17,4000,16000,32,6,12},
-        new double[] {18,1500,768,1000,0,0,0},
-        new double[] {20,1500,768,2000,0,0,0},
-        new double[] {20,800,768,2000,0,0,0},
-        new double[] {30,50,2000,4000,0,3,6},
-        new double[] {44,50,2000,8000,8,3,6},
-        new double[] {44,50,2000,8000,8,1,6},
-        new double[] {82,50,2000,16000,24,1,6},
-        new double[] {82,50,2000,16000,24,1,6},
-        new double[] {128,50,8000,16000,48,1,10},
-        new double[] {37,100,1000,8000,0,2,6},
-        new double[] {46,100,1000,8000,24,2,6},
-        new double[] {46,100,1000,8000,24,3,6},
-        new double[] {80,50,2000,16000,12,3,16},
-        new double[] {88,50,2000,16000,24,6,16},
-        new double[] {88,50,2000,16000,24,6,16},
-        new double[] {33,150,512,4000,0,8,128},
-        new double[] {46,115,2000,8000,16,1,3},
-        new double[] {29,115,2000,4000,2,1,5},
-        new double[] {53,92,2000,8000,32,1,6},
-        new double[] {53,92,2000,8000,32,1,6},
-        new double[] {41,92,2000,8000,4,1,6},
-        new double[] {86,75,4000,16000,16,1,6},
-        new double[] {95,60,4000,16000,32,1,6},
-        new double[] {107,60,2000,16000,64,5,8},
-        new double[] {117,60,4000,16000,64,5,8},
-        new double[] {119,50,4000,16000,64,5,10},
-        new double[] {120,72,4000,16000,64,8,16},
-        new double[] {48,72,2000,8000,16,6,8},
-        new double[] {126,40,8000,16000,32,8,16},
-        new double[] {266,40,8000,32000,64,8,24},
-        new double[] {270,35,8000,32000,64,8,24},
-        new double[] {426,38,16000,32000,128,16,32},
-        new double[] {151,48,4000,24000,32,8,24},
-        new double[] {267,38,8000,32000,64,8,24},
-        new double[] {603,30,16000,32000,256,16,24},
-        new double[] {19,112,1000,1000,0,1,4},
-        new double[] {21,84,1000,2000,0,1,6},
-        new double[] {26,56,1000,4000,0,1,6},
-        new double[] {35,56,2000,6000,0,1,8},
-        new double[] {41,56,2000,8000,0,1,8},
-        new double[] {47,56,4000,8000,0,1,8},
-        new double[] {62,56,4000,12000,0,1,8},
-        new double[] {78,56,4000,16000,0,1,8},
-        new double[] {80,38,4000,8000,32,16,32},
-        new double[] {80,38,4000,8000,32,16,32},
-        new double[] {142,38,8000,16000,64,4,8},
-        new double[] {281,38,8000,24000,160,4,8},
-        new double[] {190,38,4000,16000,128,16,32},
-        new double[] {21,200,1000,2000,0,1,2},
-        new double[] {25,200,1000,4000,0,1,4},
-        new double[] {67,200,2000,8000,64,1,5},
-        new double[] {24,250,512,4000,0,1,7},
-        new double[] {24,250,512,4000,0,4,7},
-        new double[] {64,250,1000,16000,1,1,8},
-        new double[] {25,160,512,4000,2,1,5},
-        new double[] {20,160,512,2000,2,3,8},
-        new double[] {29,160,1000,4000,8,1,14},
-        new double[] {43,160,1000,8000,16,1,14},
-        new double[] {53,160,2000,8000,32,1,13},
-        new double[] {19,240,512,1000,8,1,3},
-        new double[] {22,240,512,2000,8,1,5},
-        new double[] {31,105,2000,4000,8,3,8},
-        new double[] {41,105,2000,6000,16,6,16},
-        new double[] {47,105,2000,8000,16,4,14},
-        new double[] {99,52,4000,16000,32,4,12},
-        new double[] {67,70,4000,12000,8,6,8},
-        new double[] {81,59,4000,12000,32,6,12},
-        new double[] {149,59,8000,16000,64,12,24},
-        new double[] {183,26,8000,24000,32,8,16},
-        new double[] {275,26,8000,32000,64,12,16},
-        new double[] {382,26,8000,32000,128,24,32},
-        new double[] {56,116,2000,8000,32,5,28},
-        new double[] {182,50,2000,32000,24,6,26},
-        new double[] {227,50,2000,32000,48,26,52},
-        new double[] {341,50,2000,32000,112,52,104},
-        new double[] {360,50,4000,32000,112,52,104},
-        new double[] {919,30,8000,64000,96,12,176},
-        new double[] {978,30,8000,64000,128,12,176},
-        new double[] {24,180,262,4000,0,1,3},
-        new double[] {24,180,512,4000,0,1,3},
-        new double[] {24,180,262,4000,0,1,3},
-        new double[] {24,180,512,4000,0,1,3},
-        new double[] {37,124,1000,8000,0,1,8},
-        new double[] {50,98,1000,8000,32,2,8},
-        new double[] {41,125,2000,8000,0,2,14},
-        new double[] {47,480,512,8000,32,0,0},
-        new double[] {25,480,1000,4000,0,0,0},
-    };
-
-    /** */
-    private static final List<Double> labelsClearedMachines = new ArrayList<>();
-
-    /** */
-    private static final List<Vector> vectorsClearedMachines = new ArrayList<>();
-
-    static {
-        Arrays.stream(dataIris).forEach(e -> {
-            labelsIris.add(e[0]);
-            vectorsIris.add(new DenseLocalOnHeapVector(new double[] {e[1], e[2], e[3], e[4]}));
-        });
-
-        Arrays.stream(dataClearedMachines).forEach(e -> {
-            labelsClearedMachines.add(e[0]);
-            vectorsClearedMachines.add(new DenseLocalOnHeapVector(new double[] {e[1], e[2], e[3], e[4]}));
-        });
-    }
-}


Mime
View raw message