List of usage examples for org.apache.commons.math3.stat.descriptive DescriptiveStatistics clear
public void clear()
From source file:org.wso2.carbon.ml.core.spark.models.ext.AnomalyDetectionModel.java
/** * This method is to get the percentile distance to a given cluster *///from w w w . j a v a 2 s .co m private double getPercentileDistance(double percentileValue, int clusterIndex) { // Get a DescriptiveStatistics instance DescriptiveStatistics stats = new DescriptiveStatistics(); // calculating percentile distance for (double distance : clusterIndexToDistancesListMap.get(clusterIndex)) { stats.addValue(distance); } double percentileDistance = stats.getPercentile(percentileValue); stats.clear(); return percentileDistance; }