Changeset 13994 for branches/HeuristicLab.RegressionSolutionGradientView
- Timestamp:
- 07/04/16 23:40:44 (8 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView
- Files:
-
- 1 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Algorithms.DataAnalysis merged: 13975,13978,13992
- Property svn:mergeinfo changed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/ZeroR.cs
r13098 r13994 64 64 .MaxItems(kvp => kvp.Value).Select(x => x.Key).First(); 65 65 66 var model = new ConstantModel(dominantClass );66 var model = new ConstantModel(dominantClass, target); 67 67 var solution = model.CreateClassificationSolution(problemData); 68 68 return solution; -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs
r13948 r13994 181 181 public GradientBoostingRegressionAlgorithm() { 182 182 Problem = new RegressionProblem(); // default problem 183 var mctsSymbReg = new MctsSymbolicRegressionAlgorithm(); 184 mctsSymbReg.Iterations = 10000; 185 mctsSymbReg.StoreAlgorithmInEachRun = false; 186 var sgp = CreateOSGP(); 183 var osgp = CreateOSGP(); 187 184 var regressionAlgs = new ItemSet<IAlgorithm>(new IAlgorithm[] { 188 185 new RandomForestRegression(), 189 sgp, 190 mctsSymbReg 186 osgp, 191 187 }); 192 188 foreach (var alg in regressionAlgs) alg.Prepare(); … … 208 204 new DoubleValue(0.5))); 209 205 Parameters.Add(new ConstrainedValueParameter<IAlgorithm>(RegressionAlgorithmParameterName, 210 "The regression algorithm to use as a base learner", regressionAlgs, mctsSymbReg));206 "The regression algorithm to use as a base learner", regressionAlgs, osgp)); 211 207 Parameters.Add(new FixedValueParameter<StringValue>(RegressionAlgorithmSolutionResultParameterName, 212 208 "The name of the solution produced by the regression algorithm", new StringValue("Solution"))); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeBuilder.cs
r13948 r13994 22 22 23 23 using System; 24 using System.Collections;25 24 using System.Collections.Generic; 26 25 using System.Diagnostics; … … 129 128 130 129 // y and curPred are changed in gradient boosting 131 this.y = y; 132 this.curPred = curPred; 130 this.y = y; 131 this.curPred = curPred; 133 132 134 133 // shuffle row idx … … 137 136 int nRows = idx.Count(); 138 137 139 // shuffle variable idx138 // shuffle variable names 140 139 HeuristicLab.Random.ListExtensions.ShuffleInPlace(allowedVariables, random); 141 140 … … 176 175 CreateRegressionTreeFromQueue(maxSize, lossFunction); 177 176 178 return new RegressionTreeModel(tree.ToArray() );177 return new RegressionTreeModel(tree.ToArray(), problemData.TargetVariable); 179 178 } 180 179 -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
r13948 r13994 149 149 #endregion 150 150 151 152 153 154 151 [StorableConstructor] 155 152 private RegressionTreeModel(bool serializing) : base(serializing) { } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r13858 r13994 240 240 </Compile> 241 241 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 242 <Compile Include="GaussianProcess\StudentTProcessRegressionModelCreator.cs" />243 <Compile Include="GaussianProcess\StudentTProcessModel.cs" />244 242 <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceSpectralMixture.cs" /> 245 243 <Compile Include="GaussianProcess\CovarianceFunctions\CovariancePiecewisePolynomial.cs" /> -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 13985-13987,13992
- Property svn:mergeinfo changed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Views merged: 13958,13992
- Property svn:mergeinfo changed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r13100 r13994 292 292 private IRegressionSolution CreateConstantSolution() { 293 293 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average(); 294 var model = new ConstantModel(averageTrainingTarget );294 var model = new ConstantModel(averageTrainingTarget, ProblemData.TargetVariable); 295 295 var solution = model.CreateRegressionSolution(ProblemData); 296 296 solution.Name = "Baseline (constant)"; -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r13764 r13994 36 36 private const string TEST_SERIES = "Test samples"; 37 37 38 private const int OPACITY_LEVEL = 150; 39 38 40 public new IRegressionSolution Content { 39 41 get { return (IRegressionSolution)base.Content; } … … 60 62 this.chart.TextAntiAliasingQuality = TextAntiAliasingQuality.High; 61 63 this.chart.AxisViewChanged += new EventHandler<System.Windows.Forms.DataVisualization.Charting.ViewEventArgs>(chart_AxisViewChanged); 64 65 //make series colors semi transparent 66 this.chart.ApplyPaletteColors(); 67 this.chart.Series[ALL_SERIES].Color = Color.FromArgb(OPACITY_LEVEL, this.chart.Series[ALL_SERIES].Color); 68 this.chart.Series[TRAINING_SERIES].Color = Color.FromArgb(OPACITY_LEVEL, this.chart.Series[TRAINING_SERIES].Color); 69 this.chart.Series[TEST_SERIES].Color = Color.FromArgb(OPACITY_LEVEL, this.chart.Series[TEST_SERIES].Color); 70 71 //change all markers to circles 72 this.chart.Series[ALL_SERIES].MarkerStyle = MarkerStyle.Circle; 73 this.chart.Series[TRAINING_SERIES].MarkerStyle = MarkerStyle.Circle; 74 this.chart.Series[TEST_SERIES].MarkerStyle = MarkerStyle.Circle; 62 75 63 76 //configure axis -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r13948 r13994 151 151 <SpecificVersion>False</SpecificVersion> 152 152 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 153 <Private>False</Private> 154 </Reference> 155 <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 156 <SpecificVersion>False</SpecificVersion> 157 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> 153 158 <Private>False</Private> 154 159 </Reference> … … 317 322 </BootstrapperPackage> 318 323 </ItemGroup> 324 <ItemGroup> 325 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 326 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 327 <Name>HeuristicLab.Collections-3.3</Name> 328 <Private>False</Private> 329 </ProjectReference> 330 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 331 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project> 332 <Name>HeuristicLab.Common.Resources-3.3</Name> 333 <Private>False</Private> 334 </ProjectReference> 335 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 336 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project> 337 <Name>HeuristicLab.Common-3.3</Name> 338 <Private>False</Private> 339 </ProjectReference> 340 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 341 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project> 342 <Name>HeuristicLab.Core-3.3</Name> 343 <Private>False</Private> 344 </ProjectReference> 345 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 346 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> 347 <Name>HeuristicLab.Data-3.3</Name> 348 <Private>False</Private> 349 </ProjectReference> 350 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 351 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 352 <Name>HeuristicLab.Optimization-3.3</Name> 353 <Private>False</Private> 354 </ProjectReference> 355 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 356 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> 357 <Name>HeuristicLab.Parameters-3.3</Name> 358 <Private>False</Private> 359 </ProjectReference> 360 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 361 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 362 <Name>HeuristicLab.Persistence-3.3</Name> 363 <Private>False</Private> 364 </ProjectReference> 365 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 366 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 367 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 368 <Private>False</Private> 369 </ProjectReference> 370 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 371 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 372 <Name>HeuristicLab.Problems.Instances-3.3</Name> 373 <Private>False</Private> 374 </ProjectReference> 375 </ItemGroup> 319 376 <ItemGroup /> 320 377 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationModel.cs
r13948 r13994 55 55 } 56 56 57 [StorableHook(HookType.AfterDeserialization)] 58 private void AfterDeserialization() { 59 // BackwardsCompatibility3.3 60 #region Backwards compatible code, remove with 3.4 61 targetVariable = string.Empty; 62 #endregion 63 } 64 57 65 public abstract IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows); 58 66 public abstract IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisSolution.cs
r13948 r13994 89 89 protected abstract void RecalculateResults(); 90 90 91 public virtual IEnumerable<string> GetUsedVariablesForPrediction() { 92 return this.ProblemData.AllowedInputVariables; 93 } 94 91 95 private void ProblemData_Changed(object sender, EventArgs e) { 92 96 OnProblemDataChanged(); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r13948 r13994 64 64 65 65 public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 66 return new ConstantRegressionSolution(new ConstantModel(constant ), new RegressionProblemData(problemData));66 return new ConstantRegressionSolution(new ConstantModel(constant, TargetVariable), new RegressionProblemData(problemData)); 67 67 } 68 68 -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionModel.cs
r13948 r13994 56 56 } 57 57 58 [StorableHook(HookType.AfterDeserialization)] 59 private void AfterDeserialization() { 60 // BackwardsCompatibility3.3 61 #region Backwards compatible code, remove with 3.4 62 targetVariable = string.Empty; 63 #endregion 64 } 58 65 public abstract IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows); 59 66 public abstract IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r13766 r13994 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.Random; 32 33 33 34 namespace HeuristicLab.Problems.DataAnalysis { 34 35 [StorableClass] 35 [Item("RegressionSolution Impacts Calculator", "Calculation of the impacts of input variables for a concrete")]36 [Item("RegressionSolution Impacts Calculator", "Calculation of the impacts of input variables for any regression solution")] 36 37 public sealed class RegressionSolutionVariableImpactsCalculator : ParameterizedNamedItem { 37 38 public enum ReplacementMethodEnum { 38 39 Median, 39 Average 40 Average, 41 Shuffle, 42 Noise 40 43 } 41 44 … … 77 80 : base() { 78 81 Parameters.Add(new FixedValueParameter<EnumValue<ReplacementMethodEnum>>(ReplacementParameterName, "The replacement method for variables during impact calculation.", new EnumValue<ReplacementMethodEnum>(ReplacementMethodEnum.Median))); 79 Parameters.Add(new FixedValueParameter<EnumValue<DataPartitionEnum>>( ReplacementParameterName, "The data partition on which the impacts are calculated.", new EnumValue<DataPartitionEnum>(DataPartitionEnum.Training)));82 Parameters.Add(new FixedValueParameter<EnumValue<DataPartitionEnum>>(DataPartitionParameterName, "The data partition on which the impacts are calculated.", new EnumValue<DataPartitionEnum>(DataPartitionEnum.Training))); 80 83 } 81 84 … … 138 141 var originalValues = dataset.GetReadOnlyDoubleValues(variable).ToList(); 139 142 double replacementValue; 143 List<double> replacementValues; 144 IRandom rand; 140 145 141 146 switch (replacement) { 142 147 case ReplacementMethodEnum.Median: 143 148 replacementValue = rows.Select(r => originalValues[r]).Median(); 149 replacementValues = Enumerable.Repeat(replacementValue, dataset.Rows).ToList(); 144 150 break; 145 151 case ReplacementMethodEnum.Average: 146 152 replacementValue = rows.Select(r => originalValues[r]).Average(); 153 replacementValues = Enumerable.Repeat(replacementValue, dataset.Rows).ToList(); 147 154 break; 155 case ReplacementMethodEnum.Shuffle: 156 // new var has same empirical distribution but the relation to y is broken 157 rand = new FastRandom(31415); 158 replacementValues = rows.Select(r => originalValues[r]).Shuffle(rand).ToList(); 159 break; 160 case ReplacementMethodEnum.Noise: 161 var avg = rows.Select(r => originalValues[r]).Average(); 162 var stdDev = rows.Select(r => originalValues[r]).StandardDeviation(); 163 rand = new FastRandom(31415); 164 replacementValues = rows.Select(_ => NormalDistributedRandom.NextDouble(rand, avg, stdDev)).ToList(); 165 break; 166 148 167 default: 149 168 throw new ArgumentException(string.Format("ReplacementMethod {0} cannot be handled.", replacement)); 150 169 } 151 170 152 dataset.ReplaceVariable(variable, Enumerable.Repeat(replacementValue, dataset.Rows).ToList());171 dataset.ReplaceVariable(variable, replacementValues); 153 172 //mkommend: ToList is used on purpose to avoid lazy evaluation that could result in wrong estimates due to variable replacements 154 173 var estimates = model.GetEstimatedValues(dataset, rows).ToList(); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame
r13321 r13994 38 38 [PluginDependency("HeuristicLab.Persistence", "3.3")] 39 39 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 40 [PluginDependency("HeuristicLab.Random", "3.3")] 40 41 public class HeuristicLabProblemsDataAnalysisPlugin : PluginBase { 41 42 }
Note: See TracChangeset
for help on using the changeset viewer.