- Timestamp:
- 04/16/13 13:13:41 (11 years ago)
- Location:
- branches/OaaS
- Files:
-
- 21 edited
- 18 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
-
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
r8139 r9363 96 96 } 97 97 98 int classValuesCount = Content.ProblemData.Class Values.Count;98 int classValuesCount = Content.ProblemData.Classes; 99 99 int solutionsCount = Content.ClassificationSolutions.Count(); 100 100 string[,] values = new string[indices.Length, 5 + classValuesCount + solutionsCount]; … … 106 106 int row = indices[i]; 107 107 values[i, 0] = row.ToString(); 108 values[i, 1] = target[ i].ToString();108 values[i, 1] = target[row].ToString(); 109 109 //display only indices and target values if no models are present 110 110 if (solutionsCount > 0) { 111 111 values[i, 2] = estimatedClassValues[i].ToString(); 112 values[i, 3] = (target[ i].IsAlmost(estimatedClassValues[i])).ToString();112 values[i, 3] = (target[row].IsAlmost(estimatedClassValues[i])).ToString(); 113 113 var groups = 114 114 estimatedValuesVector[i].GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList(); 115 115 var estimationCount = groups.Where(g => g.Key != null).Select(g => g.Count).Sum(); 116 values[i, 4] = 117 (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString(); 118 for (int classIndex = 0; classIndex < Content.ProblemData.ClassValues.Count; classIndex++) { 119 var group = groups.Where(g => g.Key == Content.ProblemData.ClassValues[classIndex]).SingleOrDefault(); 116 // take care of divide by zero 117 if (estimationCount != 0) { 118 values[i, 4] = (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString(); 119 } else { 120 values[i, 4] = double.NaN.ToString(); 121 } 122 for (int classIndex = 0; classIndex < Content.ProblemData.Classes; classIndex++) { 123 var group = groups.Where(g => g.Key == Content.ProblemData.ClassValues.ElementAt(classIndex)).SingleOrDefault(); 120 124 if (group == null) values[i, 5 + classIndex] = 0.ToString(); 121 125 else values[i, 5 + classIndex] = group.Count.ToString(); -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs
r7259 r9363 20 20 #endregion 21 21 22 using System; 22 23 using System.Linq; 23 24 using System.Windows.Forms; 24 25 using HeuristicLab.Common; 26 using HeuristicLab.Core; 25 27 using HeuristicLab.Core.Views; 26 28 using HeuristicLab.MainForm; … … 83 85 solutions = solutions.Select(s => cloner.Clone(s)); 84 86 } 85 foreach (var solution in solutions) 86 Content.Add(solution); 87 var solutionCollection = Content as ItemCollection<IClassificationSolution>; 88 if (solutionCollection != null) { 89 solutionCollection.AddRange(solutions); 90 } else { 91 foreach (var solution in solutions) 92 Content.Add(solution); 93 } 94 } 95 } 96 protected override void itemsListView_KeyDown(object sender, KeyEventArgs e) { 97 var solutionCollection = Content as ItemCollection<IClassificationSolution>; 98 if (e.KeyCode == Keys.Delete && solutionCollection != null) { 99 if ((itemsListView.SelectedItems.Count > 0) && !Content.IsReadOnly && !ReadOnly) { 100 solutionCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(x => (IClassificationSolution)x.Tag)); 101 } 102 } else { 103 base.itemsListView_KeyDown(sender, e); 104 } 105 } 106 protected override void removeButton_Click(object sender, EventArgs e) { 107 var solutionCollection = Content as ItemCollection<IClassificationSolution>; 108 if (itemsListView.SelectedItems.Count > 0 && solutionCollection != null) { 109 solutionCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(x => (IClassificationSolution)x.Tag)); 110 itemsListView.SelectedItems.Clear(); 111 } else { 112 base.removeButton_Click(sender, e); 87 113 } 88 114 } -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionConfusionMatrixView.Designer.cs
r7967 r9363 1 namespace HeuristicLab.Problems.DataAnalysis.Views { 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 namespace HeuristicLab.Problems.DataAnalysis.Views { 2 23 partial class ClassificationSolutionConfusionMatrixView { 3 24 /// <summary> -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.Designer.cs
r7967 r9363 1 namespace HeuristicLab.Problems.DataAnalysis.Views { 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 namespace HeuristicLab.Problems.DataAnalysis.Views { 2 23 partial class DiscriminantFunctionClassificationRocCurvesView { 3 24 /// <summary> -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.cs
r8139 r9363 114 114 maxThreshold += thresholdIncrement; 115 115 116 List<double> classValues = Content.ProblemData.ClassValues. OrderBy(x => x).ToList();116 List<double> classValues = Content.ProblemData.ClassValues.ToList(); 117 117 118 118 foreach (double classValue in classValues) { -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.Designer.cs
r7967 r9363 1 namespace HeuristicLab.Problems.DataAnalysis.Views { 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 namespace HeuristicLab.Problems.DataAnalysis.Views { 2 23 partial class DiscriminantFunctionClassificationSolutionThresholdView { 3 24 /// <summary> … … 92 113 93 114 } 94 95 115 #endregion 96 116 -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs
r8139 r9363 65 65 66 66 this.chart.ChartAreas[0].AxisY.Title = "Estimated Values"; 67 this.chart.ChartAreas[0].AxisY.IsStartedFromZero = false; 67 68 this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; 68 69 this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; … … 169 170 chart.Annotations.Clear(); 170 171 int classIndex = 1; 172 IClassificationProblemData problemData = Content.ProblemData; 173 var classValues = Content.Model.ClassValues.ToArray(); 174 Axis y = chart.ChartAreas[0].AxisY; 175 Axis x = chart.ChartAreas[0].AxisX; 176 string name; 171 177 foreach (double threshold in Content.Model.Thresholds) { 172 178 if (!double.IsInfinity(threshold)) { … … 176 182 annotation.LineWidth = 2; 177 183 annotation.LineColor = Color.Red; 178 179 184 annotation.IsInfinitive = true; 180 185 annotation.ClipToChartArea = chart.ChartAreas[0].Name; 181 186 annotation.Tag = classIndex; //save classIndex as Tag to avoid moving the threshold accross class bounderies 182 183 187 annotation.AxisX = chart.ChartAreas[0].AxisX; 184 annotation.AxisY = chart.ChartAreas[0].AxisY;188 annotation.AxisY = y; 185 189 annotation.Y = threshold; 186 190 191 name = problemData.GetClassName(classValues[classIndex - 1]); 192 TextAnnotation beneathLeft = CreateTextAnnotation(name, classIndex, x, y, x.Minimum, threshold, ContentAlignment.TopLeft); 193 TextAnnotation beneathRight = CreateTextAnnotation(name, classIndex, x, y, x.Maximum, threshold, ContentAlignment.TopRight); 194 195 name = problemData.GetClassName(classValues[classIndex]); 196 TextAnnotation aboveLeft = CreateTextAnnotation(name, classIndex, x, y, x.Minimum, threshold, ContentAlignment.BottomLeft); 197 TextAnnotation aboveRight = CreateTextAnnotation(name, classIndex, x, y, x.Maximum, threshold, ContentAlignment.BottomRight); 198 187 199 chart.Annotations.Add(annotation); 200 chart.Annotations.Add(beneathLeft); 201 chart.Annotations.Add(aboveLeft); 202 chart.Annotations.Add(beneathRight); 203 chart.Annotations.Add(aboveRight); 204 205 beneathLeft.ResizeToContent(); 206 beneathRight.ResizeToContent(); 207 aboveLeft.ResizeToContent(); 208 aboveRight.ResizeToContent(); 209 210 beneathRight.Width = -beneathRight.Width; 211 aboveLeft.Height = -aboveLeft.Height; 212 aboveRight.Height = -aboveRight.Height; 213 aboveRight.Width = -aboveRight.Width; 214 188 215 classIndex++; 189 216 } 190 217 } 218 } 219 220 private TextAnnotation CreateTextAnnotation(string name, int classIndex, Axis axisX, Axis axisY, double x, double y, ContentAlignment alignment) { 221 TextAnnotation annotation = new TextAnnotation(); 222 annotation.Text = name; 223 annotation.AllowMoving = true; 224 annotation.AllowResizing = false; 225 annotation.AllowSelecting = false; 226 annotation.IsSizeAlwaysRelative = true; 227 annotation.ClipToChartArea = chart.ChartAreas[0].Name; 228 annotation.Tag = classIndex; 229 annotation.AxisX = axisX; 230 annotation.AxisY = axisY; 231 annotation.Alignment = alignment; 232 annotation.X = x; 233 annotation.Y = y; 234 return annotation; 191 235 } 192 236 … … 238 282 double[] thresholds = Content.Model.Thresholds.ToArray(); 239 283 thresholds[classIndex] = e.NewLocationY; 284 Array.Sort(thresholds); 240 285 Content.Model.SetThresholdsAndClassValues(thresholds, Content.Model.ClassValues); 241 286 } -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r7823 r9363 93 93 </PropertyGroup> 94 94 <ItemGroup> 95 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 96 <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath> 97 <Private>False</Private> 98 </Reference> 95 99 <Reference Include="System" /> 96 100 <Reference Include="System.Core"> … … 122 126 <DependentUpon>ClassificationEnsembleSolutionModelView.cs</DependentUpon> 123 127 </Compile> 128 <Compile Include="Classification\ClassificationFeatureCorrelationView.cs"> 129 <SubType>UserControl</SubType> 130 </Compile> 131 <Compile Include="Classification\ClassificationFeatureCorrelationView.Designer.cs"> 132 <DependentUpon>ClassificationFeatureCorrelationView.cs</DependentUpon> 133 </Compile> 134 <Compile Include="Classification\ClassificationTimeframeFeatureCorrelationView.cs"> 135 <SubType>UserControl</SubType> 136 </Compile> 137 <Compile Include="Classification\ClassificationTimeframeFeatureCorrelationView.Designer.cs"> 138 <DependentUpon>ClassificationTimeframeFeatureCorrelationView.cs</DependentUpon> 139 </Compile> 140 <Compile Include="Classification\DiscriminantFunctionClassificationModelView.cs"> 141 <SubType>UserControl</SubType> 142 </Compile> 143 <Compile Include="Classification\DiscriminantFunctionClassificationModelView.Designer.cs"> 144 <DependentUpon>DiscriminantFunctionClassificationModelView.cs</DependentUpon> 145 </Compile> 146 <Compile Include="Clustering\ClusteringSolutionVisualizationView.cs"> 147 <SubType>UserControl</SubType> 148 </Compile> 149 <Compile Include="Clustering\ClusteringSolutionVisualizationView.Designer.cs"> 150 <DependentUpon>ClusteringSolutionVisualizationView.cs</DependentUpon> 151 </Compile> 152 <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationView.cs"> 153 <SubType>UserControl</SubType> 154 </Compile> 155 <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationView.Designer.cs"> 156 <DependentUpon>AbstractFeatureCorrelationView.cs</DependentUpon> 157 </Compile> 124 158 <Compile Include="DataAnalysisSolutionEvaluationView.cs"> 125 159 <SubType>UserControl</SubType> … … 128 162 <DependentUpon>DataAnalysisSolutionEvaluationView.cs</DependentUpon> 129 163 </Compile> 164 <Compile Include="FeatureCorrelation\EnhancedStringConvertibleMatrixView.cs"> 165 <SubType>UserControl</SubType> 166 </Compile> 167 <Compile Include="FeatureCorrelation\EnhancedStringConvertibleMatrixView.Designer.cs"> 168 <DependentUpon>EnhancedStringConvertibleMatrixView.cs</DependentUpon> 169 </Compile> 170 <Compile Include="FeatureCorrelation\FeatureCorrelationCalculator.cs" /> 171 <Compile Include="FeatureCorrelation\FeatureCorrelationView.cs"> 172 <SubType>UserControl</SubType> 173 </Compile> 174 <Compile Include="FeatureCorrelation\FeatureCorrelationView.Designer.cs"> 175 <DependentUpon>FeatureCorrelationView.cs</DependentUpon> 176 </Compile> 130 177 <Compile Include="Plugin.cs" /> 178 <Compile Include="ProblemDataView.cs"> 179 <SubType>UserControl</SubType> 180 </Compile> 181 <Compile Include="ProblemDataView.Designer.cs"> 182 <DependentUpon>ProblemDataView.cs</DependentUpon> 183 </Compile> 184 <Compile Include="Regression\RegressionFeatureCorrelationView.cs"> 185 <SubType>UserControl</SubType> 186 </Compile> 187 <Compile Include="Regression\RegressionFeatureCorrelationView.Designer.cs"> 188 <DependentUpon>RegressionFeatureCorrelationView.cs</DependentUpon> 189 </Compile> 190 <Compile Include="Regression\RegressionTimeframeFeatureCorrelationView.cs"> 191 <SubType>UserControl</SubType> 192 </Compile> 193 <Compile Include="Regression\RegressionTimeframeFeatureCorrelationView.Designer.cs"> 194 <DependentUpon>RegressionTimeframeFeatureCorrelationView.cs</DependentUpon> 195 </Compile> 131 196 <Compile Include="Regression\RegressionEnsembleSolutionModelView.cs"> 132 197 <SubType>UserControl</SubType> … … 256 321 <Compile Include="Solution Views\RegressionSolutionView.Designer.cs"> 257 322 <DependentUpon>RegressionSolutionView.cs</DependentUpon> 323 </Compile> 324 <Compile Include="FeatureCorrelation\TimeframeFeatureCorrelationView.cs"> 325 <SubType>UserControl</SubType> 326 </Compile> 327 <Compile Include="FeatureCorrelation\TimeframeFeatureCorrelationView.Designer.cs"> 328 <DependentUpon>TimeframeFeatureCorrelationView.cs</DependentUpon> 329 </Compile> 330 <Compile Include="Solution Views\TimeSeriesPrognosisSolutionView.cs"> 331 <SubType>UserControl</SubType> 332 </Compile> 333 <Compile Include="Solution Views\TimeSeriesPrognosisSolutionView.Designer.cs"> 334 <DependentUpon>TimeSeriesPrognosisSolutionView.cs</DependentUpon> 335 </Compile> 336 <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisResultsView.cs"> 337 <SubType>UserControl</SubType> 338 </Compile> 339 <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisResultsView.Designer.cs"> 340 <DependentUpon>TimeSeriesPrognosisResultsView.cs</DependentUpon> 341 </Compile> 342 <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs"> 343 <SubType>UserControl</SubType> 344 </Compile> 345 <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.Designer.cs"> 346 <DependentUpon>TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs</DependentUpon> 258 347 </Compile> 259 348 <None Include="HeuristicLab.snk" /> … … 263 352 </ItemGroup> 264 353 <ItemGroup> 354 <ProjectReference Include="..\..\HeuristicLab.Algorithms.DataAnalysis\3.4\HeuristicLab.Algorithms.DataAnalysis-3.4.csproj"> 355 <Project>{2E782078-FA81-4B70-B56F-74CE38DAC6C8}</Project> 356 <Name>HeuristicLab.Algorithms.DataAnalysis-3.4</Name> 357 </ProjectReference> 358 <ProjectReference Include="..\..\HeuristicLab.Analysis.Views\3.3\HeuristicLab.Analysis.Views-3.3.csproj"> 359 <Project>{76945D76-CA61-4147-9DC2-0ACDCDDF87F9}</Project> 360 <Name>HeuristicLab.Analysis.Views-3.3</Name> 361 <Private>False</Private> 362 </ProjectReference> 363 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 364 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 365 <Name>HeuristicLab.Analysis-3.3</Name> 366 <Private>False</Private> 367 </ProjectReference> 265 368 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 266 369 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> … … 367 470 </ItemGroup> 368 471 <ItemGroup> 369 <Folder Include="obj\" /> 472 <EmbeddedResource Include="FeatureCorrelation\AbstractFeatureCorrelationView.resx"> 473 <DependentUpon>AbstractFeatureCorrelationView.cs</DependentUpon> 474 </EmbeddedResource> 370 475 </ItemGroup> 371 476 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> … … 378 483 --> 379 484 <PropertyGroup> 380 <PreBuildEvent >set Path=%25Path%25;$(ProjectDir);$(SolutionDir)485 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 381 486 set ProjectDir=$(ProjectDir) 382 487 set SolutionDir=$(SolutionDir) … … 385 490 call PreBuildEvent.cmd 386 491 </PreBuildEvent> 492 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 493 export ProjectDir=$(ProjectDir) 494 export SolutionDir=$(SolutionDir) 495 496 $SolutionDir/PreBuildEvent.sh 497 </PreBuildEvent> 387 498 </PropertyGroup> 388 499 </Project> -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs
r7738 r9363 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.MainForm.WindowsForms; 28 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Optimization.Views; 29 31 using HeuristicLab.Optimizer; 30 32 … … 49 51 protected override void OnActiveViewChanged(object sender, EventArgs e) { 50 52 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 51 if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked) {52 var optimizer = activeView.Content as IOptimizer;53 ToolStripItem.Enabled = GetDataAnalysisResults(optimizer).Any();54 } else {55 ToolStripItem.Enabled = false;56 }53 ToolStripItem.Enabled = GetDataAnalysisResults(activeView).Any(); 54 } 55 protected override void OnViewChanged(object sender, EventArgs e) { 56 base.OnViewChanged(sender, e); 57 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 58 ToolStripItem.Enabled = GetDataAnalysisResults(activeView).Any(); 57 59 } 58 60 59 61 public override void Execute() { 60 62 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 61 if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked) { 62 var optimizer = activeView.Content as IOptimizer; 63 var solutionGroups = from pair in GetDataAnalysisResults(optimizer) 64 group pair.Value by pair.Key into g 65 select g; 66 foreach (var group in solutionGroups) { 67 // check if all solutions in the group are either only regression or only classification solutions 68 if (group.All(s => s is IRegressionSolution)) { 69 // show all regression ensembles 70 // clone problemdata (N.B. this assumes all solutions are based on the same problem data!) 71 var problemData = (RegressionProblemData)group 72 .OfType<IRegressionSolution>() 73 .First() 74 .ProblemData.Clone(); 75 var ensemble = new RegressionEnsembleSolution(problemData); 76 ensemble.Name = group.Key + " ensemble"; 77 var nestedSolutions = group.OfType<RegressionEnsembleSolution>().SelectMany(e => e.RegressionSolutions); 78 var solutions = group.Where(s => !(s is RegressionEnsembleSolution)).OfType<IRegressionSolution>(); 79 ensemble.AddRegressionSolutions(nestedSolutions.Concat(solutions)); 80 MainFormManager.MainForm.ShowContent(ensemble); 81 } else if (group.All(s => s is IClassificationSolution)) { 82 // show all classification ensembles 83 var problemData = (ClassificationProblemData)group 84 .OfType<IClassificationSolution>() 85 .First() 86 .ProblemData.Clone(); 87 var ensemble = new ClassificationEnsembleSolution(Enumerable.Empty<IClassificationModel>(), problemData); 88 ensemble.Name = group.Key + " ensemble"; 89 var nestedSolutions = group.OfType<ClassificationEnsembleSolution>().SelectMany(e => e.ClassificationSolutions); 90 var solutions = group.Where(s => !(s is ClassificationEnsembleSolution)).OfType<IClassificationSolution>(); 91 ensemble.AddClassificationSolutions(nestedSolutions.Concat(solutions)); 92 MainFormManager.MainForm.ShowContent(ensemble); 93 } 63 var solutionGroups = from pair in GetDataAnalysisResults(activeView) 64 group pair.Value by pair.Key into g 65 select g; 66 foreach (var group in solutionGroups) { 67 // check if all solutions in the group are either only regression or only classification solutions 68 if (group.All(s => s is IRegressionSolution)) { 69 // show all regression ensembles 70 // clone problemdata (N.B. this assumes all solutions are based on the same problem data!) 71 var problemData = (RegressionProblemData)group 72 .OfType<IRegressionSolution>() 73 .First() 74 .ProblemData.Clone(); 75 var ensemble = new RegressionEnsembleSolution(problemData); 76 ensemble.Name = group.Key + " ensemble"; 77 var nestedSolutions = group.OfType<RegressionEnsembleSolution>().SelectMany(e => e.RegressionSolutions); 78 var solutions = group.Where(s => !(s is RegressionEnsembleSolution)).OfType<IRegressionSolution>(); 79 ensemble.AddRegressionSolutions(nestedSolutions.Concat(solutions)); 80 MainFormManager.MainForm.ShowContent(ensemble); 81 } else if (group.All(s => s is IClassificationSolution)) { 82 // show all classification ensembles 83 var problemData = (ClassificationProblemData)group 84 .OfType<IClassificationSolution>() 85 .First() 86 .ProblemData.Clone(); 87 var ensemble = new ClassificationEnsembleSolution(Enumerable.Empty<IClassificationModel>(), problemData); 88 ensemble.Name = group.Key + " ensemble"; 89 var nestedSolutions = group.OfType<ClassificationEnsembleSolution>().SelectMany(e => e.ClassificationSolutions); 90 var solutions = group.Where(s => !(s is ClassificationEnsembleSolution)).OfType<IClassificationSolution>(); 91 ensemble.AddClassificationSolutions(nestedSolutions.Concat(solutions)); 92 MainFormManager.MainForm.ShowContent(ensemble); 94 93 } 95 94 } 96 95 } 97 96 98 private IEnumerable<KeyValuePair<string, IItem>> GetDataAnalysisResults(IOptimizer optimizer) { 99 var allResults = from r in optimizer.Runs 97 private IEnumerable<KeyValuePair<string, IItem>> GetDataAnalysisResults(IContentView view) { 98 var empty = Enumerable.Empty<KeyValuePair<string, IItem>>(); 99 if (view == null) return empty; 100 if (view.Content == null) return empty; 101 if (view.Locked) return empty; 102 103 var optimizer = view.Content as IOptimizer; 104 if (optimizer != null) return GetDataAnalysisResults(optimizer.Runs); 105 106 RunCollectionBubbleChartView bubbleChart; 107 var viewHost = view as ViewHost; 108 if (viewHost != null) 109 bubbleChart = viewHost.ActiveView as RunCollectionBubbleChartView; 110 else bubbleChart = view as RunCollectionBubbleChartView; 111 if (bubbleChart != null && bubbleChart.SelectedRuns.Any()) return GetDataAnalysisResults(bubbleChart.SelectedRuns); 112 113 return empty; 114 } 115 116 private IEnumerable<KeyValuePair<string, IItem>> GetDataAnalysisResults(IEnumerable<IRun> runs) { 117 var allResults = from r in runs 100 118 select r.Results; 101 119 return from r in allResults -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Plugin.cs.frame
r7294 r9363 26 26 27 27 namespace HeuristicLab.Problems.DataAnalysis.Views { 28 [Plugin("HeuristicLab.Problems.DataAnalysis.Views", "Provides views for base classes for data analysis tasks.", "3.4. 2.$WCREV$")]28 [Plugin("HeuristicLab.Problems.DataAnalysis.Views", "Provides views for base classes for data analysis tasks.", "3.4.3.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Views-3.4.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")] 31 [PluginDependency("HeuristicLab.Analysis", "3.3")] 32 [PluginDependency("HeuristicLab.Collections", "3.3")] 30 33 [PluginDependency("HeuristicLab.Common", "3.3")] 31 34 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] … … 44 47 } 45 48 } 49 -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Properties/AssemblyInfo.cs.frame
r7259 r9363 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.4.0.0")] 55 [assembly: AssemblyFileVersion("3.4. 2.$WCREV$")]55 [assembly: AssemblyFileVersion("3.4.3.$WCREV$")] -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs
r7259 r9363 20 20 #endregion 21 21 22 using System; 22 23 using System.Linq; 23 24 using System.Windows.Forms; 24 25 using HeuristicLab.Common; 26 using HeuristicLab.Core; 25 27 using HeuristicLab.Core.Views; 26 28 using HeuristicLab.MainForm; … … 83 85 solutions = solutions.Select(s => cloner.Clone(s)); 84 86 } 85 foreach (var solution in solutions) 86 Content.Add(solution); 87 var solutionCollection = Content as ItemCollection<IRegressionSolution>; 88 if (solutionCollection != null) { 89 solutionCollection.AddRange(solutions); 90 } else { 91 foreach (var solution in solutions) 92 Content.Add(solution); 93 } 94 } 95 } 96 protected override void itemsListView_KeyDown(object sender, KeyEventArgs e) { 97 var solutionCollection = Content as ItemCollection<IRegressionSolution>; 98 if (e.KeyCode == Keys.Delete && solutionCollection != null) { 99 if ((itemsListView.SelectedItems.Count > 0) && !Content.IsReadOnly && !ReadOnly) { 100 solutionCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(x => (IRegressionSolution)x.Tag)); 101 } 102 } else { 103 base.itemsListView_KeyDown(sender, e); 104 } 105 } 106 protected override void removeButton_Click(object sender, EventArgs e) { 107 var solutionCollection = Content as ItemCollection<IRegressionSolution>; 108 if (itemsListView.SelectedItems.Count > 0 && solutionCollection != null) { 109 solutionCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(x => (IRegressionSolution)x.Tag)); 110 itemsListView.SelectedItems.Clear(); 111 } else { 112 base.removeButton_Click(sender, e); 87 113 } 88 114 } -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs
r8105 r9363 1 namespace HeuristicLab.Problems.DataAnalysis.Views { 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 namespace HeuristicLab.Problems.DataAnalysis.Views { 2 23 partial class RegressionSolutionErrorCharacteristicsCurveView { 3 24 /// <summary> -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r8139 r9363 235 235 private IRegressionSolution CreateConstantModel() { 236 236 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average(); 237 var solution = new ConstantRegressionModel(averageTrainingTarget).CreateRegressionSolution(ProblemData); 237 var model = new ConstantRegressionModel(averageTrainingTarget); 238 var solution = new ConstantRegressionSolution(model,(IRegressionProblemData)ProblemData.Clone()); 238 239 solution.Name = "Baseline"; 239 240 return solution; -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs
r8139 r9363 89 89 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].LegendText = ESTIMATEDVALUES_ALL_SERIES_NAME; 90 90 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].ChartType = SeriesChartType.FastLine; 91 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndices, allEstimatedValues); 92 this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); 91 if (allEstimatedValues.Count > 0) { 92 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndices, allEstimatedValues); 93 this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); 94 } 93 95 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Tag = Content; 94 96 this.ToggleSeriesData(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); … … 224 226 225 227 IEnumerable<int> indices = null; 226 IEnumerable<double>predictedValues = null;228 double[] predictedValues = null; 227 229 switch (series.Name) { 228 230 case ESTIMATEDVALUES_ALL_SERIES_NAME: 229 231 indices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray(); 230 232 var estimatedValues = Content.EstimatedValues.ToArray(); 231 predictedValues = indices.Select(index => estimatedValues[index]).To List();233 predictedValues = indices.Select(index => estimatedValues[index]).ToArray(); 232 234 break; 233 235 case ESTIMATEDVALUES_TRAINING_SERIES_NAME: … … 240 242 break; 241 243 } 242 series.Points.DataBindXY(indices, predictedValues); 243 this.InsertEmptyPoints(series); 244 if (predictedValues.Length > 0) { 245 series.Points.DataBindXY(indices, predictedValues); 246 this.InsertEmptyPoints(series); 247 } 244 248 chart.Legends[series.Legend].ForeColor = Color.Black; 245 249 UpdateCursorInterval(); -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.Designer.cs
r8104 r9363 1 namespace HeuristicLab.Problems.DataAnalysis.Views { 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 namespace HeuristicLab.Problems.DataAnalysis.Views { 2 23 partial class RegressionSolutionResidualHistogram { 3 24 /// <summary> -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs
r8125 r9363 147 147 } 148 148 149 protected override void RebuildImageList() { 150 itemsListView.SmallImageList.Images.Clear(); 151 foreach (ListViewItem listViewItem in itemsListView.Items) { 152 IResult result = listViewItem.Tag as IResult; 153 Type viewType = listViewItem.Tag as Type; 154 if (result != null) itemsListView.SmallImageList.Images.Add(result.ItemImage); 155 else if (viewType != null && typeof(IDataAnalysisSolutionEvaluationView).IsAssignableFrom(viewType)) 156 itemsListView.SmallImageList.Images.Add(((IDataAnalysisSolutionEvaluationView)Activator.CreateInstance(viewType)).ViewImage); 157 else itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Nothing); 158 159 listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1; 160 } 161 } 162 149 163 #region drag and drop 150 164 protected override void itemsListView_DragEnter(object sender, DragEventArgs e) { -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.Designer.cs
r7967 r9363 1 namespace HeuristicLab.Problems.DataAnalysis.Views.Solution_Views { 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 namespace HeuristicLab.Problems.DataAnalysis.Views.Solution_Views { 2 23 partial class NamedDataAnalysisSolutionView { 3 24 /// <summary> -
branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.cs
r7259 r9363 53 53 contentType = Content.GetType(); 54 54 panel.Controls.Clear(); 55 var viewType = MainFormManager.GetViewTypes(Content.GetType(), true). Where(t => typeof(DataAnalysisSolutionView).IsAssignableFrom(t)).FirstOrDefault();55 var viewType = MainFormManager.GetViewTypes(Content.GetType(), true).FirstOrDefault(t => typeof(DataAnalysisSolutionView).IsAssignableFrom(t)); 56 56 if (viewType != null) { 57 view = (DataAnalysisSolutionView)Activator.CreateInstance(viewType); 57 view = (DataAnalysisSolutionView)MainFormManager.CreateView(viewType); 58 view.Locked = Locked; 59 view.ReadOnly = ReadOnly; 58 60 view.Dock = DockStyle.Fill; 59 61 view.Content = Content;
Note: See TracChangeset
for help on using the changeset viewer.