Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/14 16:53:31 (10 years ago)
Author:
pfleck
Message:
  • Added ProblemDataCreator for instancing a new DataAnalysisProblemData with changed Dataset etc.
  • Added export functionality to PreprocessingContext. (cloned Algorithm or Problem)
  • Commented out code in StatisticsLogic which breaks the build. :(
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs

    r10381 r10383  
    11using System;
     2using System.Collections.Generic;
    23using System.Linq;
    34using HeuristicLab.Common;
    4 using System.Collections.Generic;
    55
    66namespace HeuristicLab.DataPreprocessing {
     
    7575    }
    7676
    77     public DateTime GetMedianDateTime(int columnIndex)
    78     {
     77    public DateTime GetMedianDateTime(int columnIndex) {
    7978      DateTime median = new DateTime();
    80       if (preprocessingData.IsType<DateTime>(columnIndex))
    81       {
    82           median = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex).Median());
     79      if (preprocessingData.IsType<DateTime>(columnIndex)) {
     80        median = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex).Median());
    8381      }
    8482      return median;
    8583    }
    8684
    87     public DateTime GetAverageDateTime(int columnIndex)
    88     {
     85    public DateTime GetAverageDateTime(int columnIndex) {
    8986      DateTime avg = new DateTime();
    90       if (preprocessingData.IsType<DateTime>(columnIndex))
    91       {
    92           avg = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex).Average());   
     87      if (preprocessingData.IsType<DateTime>(columnIndex)) {
     88        avg = GetSecondsAsDateTime(GetDateTimeAsSeconds(columnIndex).Average());
    9389      }
    9490      return avg;
     
    107103    public double GetStandardDeviation(int columnIndex) {
    108104      double stdDev = double.NaN;
     105      //TODO: fix me
     106      /*
    109107      if (preprocessingData.IsType<double>(columnIndex)) {
    110108        stdDev = preprocessingData.GetValues<double>(columnIndex).StandardDeviation();
     
    113111        stdDev = GetDateTimeAsSeconds(variableName).StandardDeviation();
    114112      }
     113      */
    115114      return stdDev;
    116115    }
    117116
    118117    public double GetVariance(int columnIndex) {
    119        double variance = double.NaN;
    120 
     118      double variance = double.NaN;
     119      //TODO: fix me
     120      /*
    121121      if (preprocessingData.IsType<double>(columnIndex)) {
    122122        variance = preprocessingData.GetValues<double>(columnIndex).Variance();
     
    125125        variance = GetDateTimeAsSeconds(variableName).Variance();
    126126      }
     127      */
    127128      return variance;
    128129    }
     
    161162    }
    162163
    163     private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex)
    164     {
    165         return preprocessingData.GetValues<DateTime>(columnIndex).Select(x => (double)x.Ticks / TimeSpan.TicksPerSecond);
     164    private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex) {
     165      return preprocessingData.GetValues<DateTime>(columnIndex).Select(x => (double)x.Ticks / TimeSpan.TicksPerSecond);
    166166    }
    167167
    168     private DateTime GetSecondsAsDateTime(double seconds)
    169     {
    170         DateTime dateTime = new DateTime();
    171         return dateTime.Add(new TimeSpan(0, 0, (int)seconds));
     168    private DateTime GetSecondsAsDateTime(double seconds) {
     169      DateTime dateTime = new DateTime();
     170      return dateTime.Add(new TimeSpan(0, 0, (int)seconds));
    172171    }
    173172  }
Note: See TracChangeset for help on using the changeset viewer.