Hi 

I have a very simple program to create a DataSet to see if we can migrate to
Ignite ML.
Strangely on the server logs, why would I get a CreateMLDataSet Class Not
found exception?


public class CreateMLDataSet {

  public static void main(String[] args) throws Exception {

    CacheConfiguration cacheCfg = new CacheConfiguration(tableName);
    IgniteCache tableCache =
ignite.getOrCreateCache(cacheCfg).withKeepBinary();

    IgniteBiFunction<BinaryObject, BinaryObject, Vector> featureExtractor =
new IgniteBiFunction<BinaryObject, BinaryObject, Vector>() {
      @Override
      public Vector apply(BinaryObject key, BinaryObject value) {
        Integer val  = (Integer)value.field("quantity");
        Vector vector = VectorUtils.of(val);
        return vector;
      }
    };

    SimpleDataset<?> dataSet = null;
    try {
      dataSet = DatasetFactory.createSimpleDataset(ignite, tableCache,
featureExtractor);
    } catch (Exception e) {
      e.printStackTrace();
    }


    // Calculation of the mean value.
    double[] mean = dataSet.mean();
    System.out.println("Mean \n\t" + Arrays.toString(mean));

    // Calculation of the standard deviation.
    double[] std = dataSet.std();
    System.out.println("Standard deviation \n\t" + Arrays.toString(std));

    // Calculation of the covariance matrix.
    double[][] cov = dataSet.cov();
    System.out.println("Covariance matrix ");
    for (double[] row : cov)
      System.out.println("\t" + Arrays.toString(row));

    // Calculation of the correlation matrix.
    double[][] corr = dataSet.corr();
    System.out.println("Correlation matrix ");
    for (double[] row : corr) System.out.println("\t" +
Arrays.toString(row));
  }
}




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to