Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/17/09 13:32:19 (15 years ago)
Author:
gkronber
Message:

Fixed a bug in the variable impact calculation operators. #750.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegressionOperator.cs

    r2367 r2368  
    139139      double n = end - start;
    140140      for (int i = 0; i < dataset.Columns; i++) {
    141         double nanRatio = CountNaN(dataset, i, start, end) / n;
     141        double nanRatio = dataset.CountMissingValues(i, start, end) / n;
    142142        if (i != targetVariable && nanRatio < 0.1 && dataset.GetRange(i, start, end) > 0.0) {
    143143          allowedColumns.Add(i);
     
    146146      return allowedColumns;
    147147    }
    148 
    149     private double CountNaN(Dataset dataset, int column, int start, int end) {
    150       double n = 0;
    151       for (int i = start; i < end; i++) {
    152         if (double.IsNaN(dataset.GetValue(i, column)) || double.IsInfinity(dataset.GetValue(i, column)))
    153           n++;
    154       }
    155       return n;
    156     }
    157 
    158148
    159149    private double[,] PrepareInputMatrix(Dataset dataset, List<int> allowedColumns, List<int> allowedRows, int minTimeOffset, int maxTimeOffset) {
Note: See TracChangeset for help on using the changeset viewer.