Package com.github.pmerienne.trident.ml.stats

Examples of com.github.pmerienne.trident.ml.stats.StreamFeatureStatistics


    // init new features
    int featuresSize = instance.features.length;
    double[] standardizedFeatures = new double[featuresSize];

    // Standardize each feature
    StreamFeatureStatistics featureStatistics;
    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

TOP

Related Classes of com.github.pmerienne.trident.ml.stats.StreamFeatureStatistics

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.