Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10169


Ignore:
Timestamp:
11/27/13 17:19:47 (11 years ago)
Author:
sbreuer
Message:
  • implemented GetStandardDeviation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/PreprocessingDataStatisticInfo.cs

    r10167 r10169  
    8989
    9090    public double GetStandardDeviation(int columnIndex) {
    91       throw new System.NotImplementedException();
     91      double stdDev = double.NaN;
     92      if (preprocessingData.IsType<double>(columnIndex)) {
     93        double avg = GetAverage(columnIndex);
     94        stdDev = Math.Sqrt(preprocessingData.GetValues<double>(columnIndex).Sum(x => (x - avg) * (x - avg)) / (preprocessingData.Rows - 1));
     95      }
     96      return stdDev;
    9297    }
    9398
Note: See TracChangeset for help on using the changeset viewer.