List of usage examples for weka.experiment Stats add
public void add(double value)
It's equivalent to add(value, 1)
From source file:machinelearningcw.EnhancedLinearPerceptron.java
public void calculateMeansAndSTDev(Instances instances) { means = new double[instances.numAttributes() - 1];//intialize means std = new double[instances.numAttributes() - 1];//intialize stdevs for (int j = 0; j < instances.numAttributes() - 1; j++) { Stats s = new Stats(); for (int i = 0; i < instances.numInstances(); i++) { s.add(instances.get(i).value(j));//adds values to calc std }/* ww w .ja v a 2s .c o m*/ s.calculateDerived(); //calculates mean and stdDev means[j] = s.mean; std[j] = s.stdDev; } }