Package com.github.pmerienne.trident.ml.core

Examples of com.github.pmerienne.trident.ml.core.Instance


      double[] features = new double[args.length];
      for (int i = 0; i < args.length; i++) {
        features[i] = Double.parseDouble(args[i]);
      }

      Instance<?> instance = new Instance(features);
      collector.emit(new Values(instance));
    }
View Full Code Here


      double[] features = new double[args.length];
      for (int i = 0; i < args.length; i++) {
        features[i] = Double.parseDouble(args[i]);
      }

      Instance<?> instance = new Instance(features);
      collector.emit(new Values(instance));
    }
View Full Code Here

      double[] features = new double[args.length];
      for (int i = 0; i < args.length; i++) {
        features[i] = Double.parseDouble(args[i]);
      }

      Instance<?> instance = new Instance(features);
      collector.emit(new Values(instance));
    }
View Full Code Here

    for (int i = 0; i < featuresSize; i++) {
      featureStatistics = streamStatistics.getFeaturesStatistics().get(i);
      standardizedFeatures[i] = (instance.features[i] - featureStatistics.getMean()) / featureStatistics.getStdDev();
    }

    Instance<?> standardizedInstance = new Instance(instance.label, standardizedFeatures);
    return standardizedInstance;
  }
View Full Code Here

  }

  @SuppressWarnings({ "rawtypes", "unchecked" })
  protected Instance<?> normalize(Instance<?> instance) {
    double[] normalizedFeatures = MathUtil.normalize(instance.features);
    Instance<?> normalizedInstance = new Instance(instance.label, normalizedFeatures);
    return normalizedInstance;
  }
View Full Code Here

TOP

Related Classes of com.github.pmerienne.trident.ml.core.Instance

Copyright © 2018 www.massapicom. 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.