Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/20/11 13:54:57 (13 years ago)
Author:
spimming
Message:

#1680:

  • merged changes from trunk into branch

' removed pre-build event for multiple app.configs

Location:
branches/HeuristicLab.Hive.Azure
Files:
3 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure

  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs

    r6982 r7215  
    2424using System.Linq;
    2525using System.Windows.Forms;
     26using HeuristicLab.Common;
    2627using HeuristicLab.Data;
    2728using HeuristicLab.MainForm;
     
    9697
    9798      int classValuesCount = Content.ProblemData.ClassValues.Count;
    98       int modelCount = Content.Model.Models.Count();
    99       string[,] values = new string[indizes.Length, 5 + classValuesCount + modelCount];
     99      int solutionsCount = Content.ClassificationSolutions.Count();
     100      string[,] values = new string[indizes.Length, 5 + classValuesCount + solutionsCount];
    100101      double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
    101102      List<List<double?>> estimatedValuesVector = GetEstimatedValues(SamplesComboBox.SelectedItem.ToString(), indizes,
     
    107108        values[i, 1] = target[i].ToString();
    108109        //display only indices and target values if no models are present
    109         if (i >= estimatedClassValues.Length) continue;
    110 
    111         values[i, 2] = estimatedClassValues[i].ToString();
    112         values[i, 3] = (target[i] == estimatedClassValues[i]).ToString();
    113         var groups = estimatedValuesVector[i].GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
    114         var estimationCount = groups.Where(g => g.Key != null).Select(g => g.Count).Sum();
    115         values[i, 4] = (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString();
    116         for (int classIndex = 0; classIndex < Content.ProblemData.ClassValues.Count; classIndex++) {
    117           var group = groups.Where(g => g.Key == Content.ProblemData.ClassValues[classIndex]).SingleOrDefault();
    118           if (group == null) values[i, 5 + classIndex] = 0.ToString();
    119           else values[i, 5 + classIndex] = group.Count.ToString();
     110        if (solutionsCount > 0) {
     111          values[i, 2] = estimatedClassValues[i].ToString();
     112          values[i, 3] = (target[i].IsAlmost(estimatedClassValues[i])).ToString();
     113          var groups =
     114            estimatedValuesVector[i].GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
     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();
     120            if (group == null) values[i, 5 + classIndex] = 0.ToString();
     121            else values[i, 5 + classIndex] = group.Count.ToString();
     122          }
     123          for (int modelIndex = 0; modelIndex < estimatedValuesVector[i].Count; modelIndex++) {
     124            values[i, 5 + classValuesCount + modelIndex] = estimatedValuesVector[i][modelIndex] == null
     125                                                             ? string.Empty
     126                                                             : estimatedValuesVector[i][modelIndex].ToString();
     127          }
    120128        }
    121         for (int modelIndex = 0; modelIndex < estimatedValuesVector[i].Count; modelIndex++) {
    122           values[i, 5 + classValuesCount + modelIndex] = estimatedValuesVector[i][modelIndex] == null
    123                                                            ? string.Empty
    124                                                            : estimatedValuesVector[i][modelIndex].ToString();
    125         }
    126 
    127129      }
    128130
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r6866 r7215  
    122122      <DependentUpon>ClassificationEnsembleSolutionModelView.cs</DependentUpon>
    123123    </Compile>
    124     <Compile Include="Plugin.cs" />
    125     <Compile Include="Solution Views\TimeSeriesPrognosisSolutionView.cs">
    126       <SubType>UserControl</SubType>
    127     </Compile>
    128     <Compile Include="Solution Views\TimeSeriesPrognosisSolutionView.Designer.cs">
    129       <DependentUpon>TimeSeriesPrognosisSolutionView.cs</DependentUpon>
    130     </Compile>
    131     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs">
    132       <SubType>UserControl</SubType>
    133     </Compile>
    134     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.Designer.cs">
    135       <DependentUpon>TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs</DependentUpon>
    136     </Compile>
    137     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionLineChartView.cs">
    138       <SubType>UserControl</SubType>
    139     </Compile>
    140     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionLineChartView.Designer.cs">
    141       <DependentUpon>TimeSeriesPrognosisSolutionLineChartView.cs</DependentUpon>
    142     </Compile>
    143     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionPrognosedValuesView.cs">
    144       <SubType>UserControl</SubType>
    145     </Compile>
    146     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionPrognosedValuesView.Designer.cs">
    147       <DependentUpon>TimeSeriesPrognosisSolutionPrognosedValuesView.cs</DependentUpon>
    148     </Compile>
    149     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionScatterPlotView.cs">
    150       <SubType>UserControl</SubType>
    151     </Compile>
    152     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionScatterPlotView.Designer.cs">
    153       <DependentUpon>TimeSeriesPrognosisSolutionScatterPlotView.cs</DependentUpon>
    154     </Compile>
    155124    <Compile Include="DataAnalysisSolutionEvaluationView.cs">
    156125      <SubType>UserControl</SubType>
     
    159128      <DependentUpon>DataAnalysisSolutionEvaluationView.cs</DependentUpon>
    160129    </Compile>
     130    <Compile Include="Plugin.cs" />
    161131    <Compile Include="Regression\RegressionSolutionErrorCharacteristicsCurveView.cs">
    162132      <SubType>UserControl</SubType>
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs

    r6642 r7215  
    4949      this.chart.TabIndex = 0;
    5050      this.chart.Text = "chart";
     51      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
    5152      //
    5253      // label1
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r6982 r7215  
    3131  [Content(typeof(IRegressionSolution))]
    3232  public partial class RegressionSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView {
     33    private IRegressionSolution constantModel;
    3334    protected const string TrainingSamples = "Training";
    3435    protected const string TestSamples = "Test";
     
    101102      if (Content == null) return;
    102103
    103       var originalValues = GetOriginalValues();
    104       var meanModelEstimatedValues = GetMeanModelEstimatedValues(originalValues);
     104      var originalValues = GetOriginalValues().ToList();
     105      constantModel = CreateConstantModel();
     106      var meanModelEstimatedValues = GetEstimatedValues(constantModel);
    105107      var meanModelResiduals = GetResiduals(originalValues, meanModelEstimatedValues);
    106108
     
    113115      UpdateSeries(meanModelResiduals, meanModelSeries);
    114116      meanModelSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(meanModelSeries);
     117      meanModelSeries.Tag = constantModel;
    115118      chart.Series.Add(meanModelSeries);
    116119
     
    225228      else UpdateChart();
    226229    }
     230
     231    #region Mean Model
     232    private void chart_MouseDown(object sender, MouseEventArgs e) {
     233      if (e.Clicks < 2) return;
     234      HitTestResult result = chart.HitTest(e.X, e.Y);
     235      if (result.ChartElementType != ChartElementType.LegendItem) return;
     236      if (result.Series.Name != constantModel.Name) return;
     237
     238      MainFormManager.MainForm.ShowContent((IRegressionSolution)result.Series.Tag);
     239    }
     240
     241    private IRegressionSolution CreateConstantModel() {
     242      double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average();
     243      var solution = new ConstantRegressionModel(averageTrainingTarget).CreateRegressionSolution(ProblemData);
     244      solution.Name = "Mean Model";
     245      return solution;
     246    }
     247    #endregion
    227248  }
    228249}
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs

    r6666 r7215  
    3737    }
    3838
     39    protected override void OnContentChanged() {
     40      base.OnContentChanged();
     41      itemsListView.Items.Remove(itemsListView.FindItemWithText("Model: ClassificationEnsembleModel"));
     42    }
     43
    3944    #region drag & drop
    4045    protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs

    r6666 r7215  
    3737    }
    3838
     39    protected override void OnContentChanged() {
     40      base.OnContentChanged();
     41      itemsListView.Items.Remove(itemsListView.FindItemWithText("Model: RegressionEnsembleModel"));
     42    }
     43
    3944    #region drag & drop
    4045    protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.