Changeset 2368 for trunk/sources/HeuristicLab.LinearRegression
- Timestamp:
- 09/17/09 13:32:19 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegressionOperator.cs
r2367 r2368 139 139 double n = end - start; 140 140 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; 142 142 if (i != targetVariable && nanRatio < 0.1 && dataset.GetRange(i, start, end) > 0.0) { 143 143 allowedColumns.Add(i); … … 146 146 return allowedColumns; 147 147 } 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 158 148 159 149 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.