Changeset 13994 for branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 07/04/16 23:40:44 (8 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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/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.