Changeset 2226 for trunk/sources/HeuristicLab.LinearRegression
- Timestamp:
- 08/03/09 15:18:36 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegressionOperator.cs ¶
r2222 r2226 26 26 using HeuristicLab.Data; 27 27 using HeuristicLab.DataAnalysis; 28 using HeuristicLab.Modeling; 28 29 using HeuristicLab.GP; 29 30 using HeuristicLab.GP.StructureIdentification; … … 54 55 double[] coefficients = CalculateCoefficients(inputMatrix, targetVector); 55 56 IFunctionTree tree = CreateModel(coefficients, allowedColumns.Select(i => dataset.GetVariableName(i)).ToList()); 56 57 57 58 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("LinearRegressionModel"), new GeneticProgrammingModel(tree))); 58 59 return null; 59 }60 61 private bool IsAlmost(double x, double y) {62 return Math.Abs(x - y) < 1.0E-12;63 60 } 64 61 … … 125 122 for (int i = 0; i < dataset.Columns; i++) { 126 123 if (i == targetVariable) continue; 127 if (! IsAlmost(dataset.GetMinimum(i, start, end),0.0) ||128 ! IsAlmost(dataset.GetMaximum(i, start, end),0.0))124 if (!dataset.GetMinimum(i, start, end).IsAlmost(0.0) || 125 !dataset.GetMaximum(i, start, end).IsAlmost(0.0)) 129 126 allowedColumns.Add(i); 130 127 }
Note: See TracChangeset
for help on using the changeset viewer.