- Timestamp:
- 07/13/21 10:55:09 (3 years ago)
- Location:
- branches/3087_Ceres_Integration
- Files:
-
- 2 deleted
- 9 edited
- 9 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3087_Ceres_Integration
- Property svn:mergeinfo changed
-
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
-
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/FactorPartialDependencePlot.cs
r17180 r18006 222 222 if (updateOnFinish) 223 223 Update(); 224 } catch (OperationCanceledException) { 224 } catch (OperationCanceledException) { 225 225 } catch (AggregateException ae) { 226 226 if (!ae.InnerExceptions.Any(e => e is OperationCanceledException)) … … 434 434 var refSolution = solutions.First(); 435 435 var refSolVars = refSolution.ProblemData.Dataset.VariableNames; 436 var refFactorVars = refSolution.ProblemData.Dataset.StringVariables; 437 var distinctVals = refFactorVars.ToDictionary(fv => fv, fv => refSolution.ProblemData.Dataset.GetStringValues(fv).Distinct().ToArray()); 438 436 439 foreach (var solution in solutions.Skip(1)) { 437 var variables1 = solution.ProblemData.Dataset.VariableNames;438 if (!variables1. All(refSolVars.Contains))440 var variables1 = new HashSet<string>(solution.ProblemData.Dataset.VariableNames); 441 if (!variables1.IsSubsetOf(refSolVars)) 439 442 return false; 440 443 441 foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) { 442 var distinctVals = refSolution.ProblemData.Dataset.GetStringValues(factorVar).Distinct(); 443 if (solution.ProblemData.Dataset.GetStringValues(factorVar).Any(val => !distinctVals.Contains(val))) return false; 444 foreach (var factorVar in solution.ProblemData.Dataset.StringVariables) { 445 var refValues = distinctVals[factorVar]; 446 var values = new HashSet<string>(solution.ProblemData.Dataset.GetStringValues(factorVar)); 447 448 if (!values.IsSubsetOf(refValues)) 449 return false; 444 450 } 445 451 } -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs
r17775 r18006 530 530 531 531 public async Task AddSolutionAsync(IRegressionSolution solution) { 532 if (solutions.Contains(solution)) 533 return; 532 534 if (!SolutionsCompatible(solutions.Concat(new[] { solution }))) 533 535 throw new ArgumentException("The solution is not compatible with the problem data."); 534 if (solutions.Contains(solution))535 return;536 536 537 537 solutions.Add(solution); … … 568 568 var refSolution = solutions.First(); 569 569 var refSolVars = refSolution.ProblemData.Dataset.VariableNames; 570 var refFactorVars = refSolution.ProblemData.Dataset.StringVariables; 571 var distinctVals = refFactorVars.ToDictionary(fv => fv, fv => refSolution.ProblemData.Dataset.GetStringValues(fv).Distinct().ToArray()); 572 570 573 foreach (var solution in solutions.Skip(1)) { 571 var variables1 = solution.ProblemData.Dataset.VariableNames;572 if (!variables1. All(refSolVars.Contains))574 var variables1 = new HashSet<string>(solution.ProblemData.Dataset.VariableNames); 575 if (!variables1.IsSubsetOf(refSolVars)) 573 576 return false; 574 577 575 foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) { 576 var distinctVals = refSolution.ProblemData.Dataset.GetStringValues(factorVar).Distinct(); 577 if (solution.ProblemData.Dataset.GetStringValues(factorVar).Any(val => !distinctVals.Contains(val))) return false; 578 foreach (var factorVar in solution.ProblemData.Dataset.StringVariables) { 579 var refValues = distinctVals[factorVar]; 580 var values = new HashSet<string>(solution.ProblemData.Dataset.GetStringValues(factorVar)); 581 582 if (!values.IsSubsetOf(refValues)) 583 return false; 578 584 } 579 585 } -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r17579 r18006 99 99 </PropertyGroup> 100 100 <ItemGroup> 101 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 102 <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath> 103 <Private>False</Private> 101 <Reference Include="ALGLIB-3.17.0, Version=3.17.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 102 <SpecificVersion>False</SpecificVersion> 103 <HintPath>..\..\bin\ALGLIB-3.17.0.dll</HintPath> 104 <Private>False</Private> 105 </Reference> 106 <Reference Include="HEAL.Attic, Version=1.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 107 <SpecificVersion>False</SpecificVersion> 108 <HintPath>..\..\bin\HEAL.Attic.dll</HintPath> 104 109 </Reference> 105 110 <Reference Include="System" /> … … 221 226 <Compile Include="Interfaces\IDataPreprocessorStarter.cs" /> 222 227 <Compile Include="Interfaces\IPartialDependencePlot.cs" /> 223 <Compile Include="IntervalCollectionView.cs">224 <SubType>UserControl</SubType>225 </Compile>226 <Compile Include="IntervalCollectionView.Designer.cs">227 <DependentUpon>IntervalCollectionView.cs</DependentUpon>228 </Compile>229 228 <Compile Include="MenuItems\ChangeDataOfOptimizersMenuItem.cs" /> 230 229 <Compile Include="MenuItems\ShrinkDataAnalysisRunsMenuItem.cs" /> … … 242 241 <DependentUpon>ProblemDataView.cs</DependentUpon> 243 242 </Compile> 243 <Compile Include="Properties\Resources.Designer.cs"> 244 <AutoGen>True</AutoGen> 245 <DesignTime>True</DesignTime> 246 <DependentUpon>Resources.resx</DependentUpon> 247 </Compile> 244 248 <Compile Include="Regression\ConfidenceRegressionSolutionEstimatedValuesView.cs"> 245 249 <SubType>UserControl</SubType> … … 254 258 <DependentUpon>ConfidenceRegressionSolutionLineChartView.cs</DependentUpon> 255 259 </Compile> 260 <Compile Include="Regression\IntervalCollectionView.cs"> 261 <SubType>UserControl</SubType> 262 </Compile> 263 <Compile Include="Regression\IntervalCollectionView.Designer.cs"> 264 <DependentUpon>IntervalCollectionView.cs</DependentUpon> 265 </Compile> 256 266 <Compile Include="Regression\RegressionEnsembleSolutionModelWeightsView.cs"> 257 267 <SubType>UserControl</SubType> … … 343 353 <Compile Include="Regression\RegressionSolutionScatterPlotView.Designer.cs"> 344 354 <DependentUpon>RegressionSolutionScatterPlotView.cs</DependentUpon> 355 </Compile> 356 <Compile Include="Regression\ShapeConstraintsView.cs"> 357 <SubType>UserControl</SubType> 358 </Compile> 359 <Compile Include="Regression\ShapeConstraintsView.Designer.cs"> 360 <DependentUpon>ShapeConstraintsView.cs</DependentUpon> 361 </Compile> 362 <Compile Include="Regression\ShapeConstraintView.cs"> 363 <SubType>UserControl</SubType> 364 </Compile> 365 <Compile Include="Regression\ShapeConstraintView.Designer.cs"> 366 <DependentUpon>ShapeConstraintView.cs</DependentUpon> 345 367 </Compile> 346 368 <Compile Include="Solution Views\ClassificationSolutionView.cs"> … … 561 583 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 562 584 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 563 <Private>False</Private>564 </ProjectReference>565 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">566 <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project>567 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>568 <Private>False</Private>569 </ProjectReference>570 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">571 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>572 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>573 585 <Private>False</Private> 574 586 </ProjectReference> … … 605 617 <DependentUpon>AbstractFeatureCorrelationView.cs</DependentUpon> 606 618 </EmbeddedResource> 619 <EmbeddedResource Include="Properties\Resources.resx"> 620 <Generator>ResXFileCodeGenerator</Generator> 621 <LastGenOutput>Resources.Designer.cs</LastGenOutput> 622 </EmbeddedResource> 607 623 </ItemGroup> 608 624 <ItemGroup> 609 <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 610 <SpecificVersion>False</SpecificVersion> 611 <HintPath>..\..\bin\HEAL.Attic.dll</HintPath> 612 <Private>False</Private> 613 </Reference> 625 <EmbeddedResource Include="Resources\shapeConstraintsHelp.rtf" /> 626 <None Include="Resources\VS2008ImageLibrary_Annotations_Information.png" /> 614 627 </ItemGroup> 615 628 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Plugin.cs.frame
r17184 r18006 28 28 [Plugin("HeuristicLab.Problems.DataAnalysis.Views", "Provides views for base classes for data analysis tasks.", "3.4.12.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Views-3.4.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.ALGLIB", "3. 7.0")]30 [PluginDependency("HeuristicLab.ALGLIB", "3.17.0")] 31 31 [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")] 32 32 [PluginDependency("HeuristicLab.Analysis", "3.3")] … … 45 45 [PluginDependency("HeuristicLab.Optimizer", "3.3")] 46 46 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 47 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")]48 47 [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")] 49 48 public class HeuristicLabProblemsDataAnalysisViewsPlugin : PluginBase { -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r17996 r18006 29 29 using HeuristicLab.MainForm; 30 30 using HeuristicLab.Optimization; 31 using HeuristicLab.PluginInfrastructure; 31 32 32 33 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 74 75 } 75 76 76 private readonly IList<IRegressionSolution> solutions = new List<IRegressionSolution>();77 private readonly List<IRegressionSolution> solutions = new List<IRegressionSolution>(); 77 78 public IEnumerable<IRegressionSolution> Solutions { 78 79 get { return solutions.AsEnumerable(); } … … 101 102 else { 102 103 // recalculate baseline solutions (for symbolic regression models the features used in the model might have changed) 103 solutions.Clear(); // remove all104 solutions.Clear(); 104 105 solutions.Add(Content); // re-add the first solution 105 // and recalculate all other solutions 106 foreach (var sol in CreateBaselineSolutions()) { 107 solutions.Add(sol); 108 } 106 var baselineSolutions = CreateBaselineSolutions(); 107 solutions.AddRange(baselineSolutions); 109 108 UpdateChart(); 110 109 } … … 114 113 else { 115 114 // recalculate baseline solutions 116 solutions.Clear(); // remove all115 solutions.Clear(); 117 116 solutions.Add(Content); // re-add the first solution 118 // and recalculate all other solutions 119 foreach (var sol in CreateBaselineSolutions()) { 120 solutions.Add(sol); 121 } 117 var baselineSolutions = CreateBaselineSolutions(); 118 solutions.AddRange(baselineSolutions); 122 119 UpdateChart(); 123 120 } … … 129 126 ReadOnly = Content == null; 130 127 if (Content != null) { 131 // recalculate all solutions132 128 solutions.Add(Content); 133 if (ProblemData.TrainingIndices.Any()) { 134 foreach (var sol in CreateBaselineSolutions()) 135 solutions.Add(sol); 136 // more solutions can be added by drag&drop 137 } 129 var baselineSolutions = CreateBaselineSolutions(); 130 solutions.AddRange(baselineSolutions); 138 131 } 139 132 UpdateChart(); … … 249 242 protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) { 250 243 switch (residualComboBox.SelectedItem.ToString()) { 251 case "Absolute error": return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)) 244 case "Absolute error": 245 return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)) 252 246 .Where(r => !double.IsNaN(r) && !double.IsInfinity(r)).ToList(); 253 case "Squared error": return originalValues.Zip(estimatedValues, (x, y) => (x - y) * (x - y)) 247 case "Squared error": 248 return originalValues.Zip(estimatedValues, (x, y) => (x - y) * (x - y)) 254 249 .Where(r => !double.IsNaN(r) && !double.IsInfinity(r)).ToList(); 255 250 case "Relative error": … … 289 284 290 285 protected virtual IEnumerable<IRegressionSolution> CreateBaselineSolutions() { 291 yield return CreateConstantSolution(); 292 yield return CreateLinearSolution(); 286 var constantSolution = CreateConstantSolution(); 287 if (constantSolution != null) yield return CreateConstantSolution(); 288 289 var linearRegressionSolution = CreateLinearSolution(); 290 if (linearRegressionSolution != null) yield return CreateLinearSolution(); 293 291 } 294 292 295 293 private IRegressionSolution CreateConstantSolution() { 294 if (!ProblemData.TrainingIndices.Any()) return null; 295 296 296 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average(); 297 297 var model = new ConstantModel(averageTrainingTarget, ProblemData.TargetVariable); … … 301 301 } 302 302 private IRegressionSolution CreateLinearSolution() { 303 double rmsError, cvRmsError; 304 var solution = LinearRegression.CreateLinearRegressionSolution((IRegressionProblemData)ProblemData.Clone(), out rmsError, out cvRmsError); 305 solution.Name = "Baseline (linear)"; 306 return solution; 303 try { 304 var solution = LinearRegression.CreateSolution((IRegressionProblemData)ProblemData.Clone(), out _, out _); 305 solution.Name = "Baseline (linear)"; 306 return solution; 307 } catch (NotSupportedException e) { 308 ErrorHandling.ShowErrorDialog("Could not create a linear regression solution.", e); 309 } catch (ArgumentException e) { 310 ErrorHandling.ShowErrorDialog("Could not create a linear regression solution.", e); 311 } 312 return null; 307 313 } 308 314 -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartViewBase.cs
r17180 r18006 81 81 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].LegendText = ESTIMATEDVALUES_TRAINING_SERIES_NAME; 82 82 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].ChartType = SeriesChartType.FastLine; 83 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.Color = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Color;84 83 int[] trainingIdx; 85 84 double[] trainingY; … … 120 119 double min = double.MaxValue, max = double.MinValue; 121 120 foreach (var point in chart.Series.SelectMany(x => x.Points)) { 122 if ( !point.YValues.Any() || double.IsInfinity(point.YValues[0]) || double.IsNaN(point.YValues[0]))121 if (point.IsEmpty || !point.YValues.Any() || double.IsInfinity(point.YValues[0]) || double.IsNaN(point.YValues[0])) 123 122 continue; 124 123 var y = point.YValues[0]; -
branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionPartialDependencePlotView.cs
r17180 r18006 119 119 120 120 // create dataset of problemData input variables and model input variables 121 // necessary workaround to have the variables in the occur ing order121 // necessary workaround to have the variables in the occurring order 122 122 var inputvariables = 123 123 new HashSet<string>(Content.ProblemData.AllowedInputVariables.Union(Content.Model.VariablesUsedForPrediction));
Note: See TracChangeset
for help on using the changeset viewer.