Changeset 15866 for branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Timestamp:
- 03/27/18 17:23:42 (7 years ago)
- Location:
- branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConfidenceBoundRegressionSolution.cs
r14099 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r14185 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionSolution.cs
r14185 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
r14710 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleProblemData.cs
r14185 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r14185 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionModel.cs
r14290 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs
r14185 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r14185 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 38 38 #region default data 39 39 private static double[,] kozaF1 = new double[,] { 40 {2.017885919, 41 {1.30060506, 42 {1.147134798, 43 {0.877182504, 44 {0.852562452, 45 {0.431095788, 46 {0.112586002, 47 {0.04594507, 48 {0.042572879, 49 {-0.074027291, 50 {-0.109178553, 51 {-0.259721109, 52 {-0.272991057, 53 {-0.161978191, 54 {-0.102489983, 55 {-0.01469968, 56 {-0.008863365, 57 {0.026751057, 58 {0.166922436, 59 {0.176953808, 60 {0.190233418, 61 {0.199800708, 62 {0.261502822, 63 {0.30182879, 64 {0.83763905, 40 {2.017885919, -1.449165046}, 41 {1.30060506, -1.344523885}, 42 {1.147134798, -1.317989331}, 43 {0.877182504, -1.266142284}, 44 {0.852562452, -1.261020794}, 45 {0.431095788, -1.158793317}, 46 {0.112586002, -1.050908405}, 47 {0.04594507, -1.021989402}, 48 {0.042572879, -1.020438113}, 49 {-0.074027291, -0.959859562}, 50 {-0.109178553, -0.938094706}, 51 {-0.259721109, -0.803635355}, 52 {-0.272991057, -0.387519561}, 53 {-0.161978191, -0.193611001}, 54 {-0.102489983, -0.114215349}, 55 {-0.01469968, -0.014918985}, 56 {-0.008863365, -0.008942626}, 57 {0.026751057, 0.026054094}, 58 {0.166922436, 0.14309643}, 59 {0.176953808, 0.1504144}, 60 {0.190233418, 0.159916534}, 61 {0.199800708, 0.166635331}, 62 {0.261502822, 0.207600348}, 63 {0.30182879, 0.232370249}, 64 {0.83763905, 0.468046718} 65 65 }; 66 66 private static readonly Dataset defaultDataset; … … 169 169 170 170 var returnValue = base.IsProblemDataCompatible(problemData, out errorMessage); 171 //check targetVariable172 if (problemData.InputVariables.All(var => var.Value != TargetVariable)) {173 errorMessage = string.Format("The target variable {0} is not present in the new problem data.", TargetVariable)174 + Environment.NewLine + errorMessage;175 return false;176 }177 171 return returnValue; 178 172 } … … 185 179 186 180 base.AdjustProblemDataProperties(problemData); 187 TargetVariable = regressionProblemData.TargetVariable;188 181 } 189 182 } -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs
r14185 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r14290 r15866 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2719_HeuristicLab.DatastreamAnalysis/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r15030 r15866 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. … … 96 96 DataPartitionEnum data = DataPartitionEnum.Training, 97 97 ReplacementMethodEnum replacementMethod = ReplacementMethodEnum.Median, 98 FactorReplacementMethodEnum factorReplacementMethod = FactorReplacementMethodEnum.Best) { 98 FactorReplacementMethodEnum factorReplacementMethod = FactorReplacementMethodEnum.Best, 99 Func<double, string, bool> progressCallback = null) { 99 100 100 101 var problemData = solution.ProblemData; … … 134 135 var allowedInputVariables = dataset.VariableNames.Where(v => inputvariables.Contains(v)).ToList(); 135 136 137 int curIdx = 0; 138 int count = allowedInputVariables.Where(problemData.Dataset.VariableHasType<double>).Count(); 136 139 // calculate impacts for double variables 137 140 foreach (var inputVariable in allowedInputVariables.Where(problemData.Dataset.VariableHasType<double>)) { 141 //Report the current progress in percent. If the callback returns true, it means the execution shall be stopped 142 if (progressCallback != null) { 143 curIdx++; 144 if (progressCallback((double)curIdx / count, string.Format("Calculating impact for variable {0} ({1} of {2})", inputVariable, curIdx, count))) { return null; } 145 } 138 146 var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows, replacementMethod); 139 147 var newR2 = OnlinePearsonsRCalculator.Calculate(targetValues, newEstimates, out error); … … 180 188 } 181 189 190 182 191 private static IEnumerable<double> EvaluateModelWithReplacedVariable(IRegressionModel model, string variable, ModifiableDataset dataset, IEnumerable<int> rows, ReplacementMethodEnum replacement = ReplacementMethodEnum.Median) { 183 192 var originalValues = dataset.GetReadOnlyDoubleValues(variable).ToList();
Note: See TracChangeset
for help on using the changeset viewer.