Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/06/14 11:12:10 (10 years ago)
Author:
mkommend
Message:

#1998: Fixed bugs in classification solution comparison view.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.cs

    r9135 r10560  
    9393          if (problemData.Classes == 2) {
    9494            dataGridView.ColumnCount = 6;
    95             dataGridView.Columns[4].HeaderText = "F1 Score Trainin";
     95            dataGridView.Columns[4].HeaderText = "F1 Score Training";
    9696            dataGridView.Columns[5].HeaderText = "F1 Score Test";
    9797          }
     
    108108            var estimatedTrainingValues = solution.Model.GetEstimatedClassValues(dataset, trainingIndizes);
    109109
    110             var testIndices = problemData.TrainingIndices;
     110            var testIndices = problemData.TestIndices;
    111111            var originalTestValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, testIndices);
    112112            var estimatedTestValues = solution.Model.GetEstimatedClassValues(dataset, testIndices);
    113113
    114114            OnlineCalculatorError errorState;
    115 
    116115            dataGridView[2, row].Value = MatthewsCorrelationCoefficientCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
    117116            dataGridView[3, row].Value = MatthewsCorrelationCoefficientCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
     
    129128
    130129    private IEnumerable<IClassificationSolution> GenerateClassificationSolutions(IClassificationProblemData problemData) {
    131       var solutions = new List<IClassificationSolution>();
     130      var newSolutions = new List<IClassificationSolution>();
    132131      var zeroR = ZeroR.CreateZeroRSolution(problemData);
    133132      zeroR.Name = "0R Classification Solution";
    134       solutions.Add(zeroR);
     133      newSolutions.Add(zeroR);
    135134      var oneR = OneR.CreateOneRSolution(problemData, 6, new FastRandom());
    136135      oneR.Name = "1R Classification Solution";
    137       solutions.Add(oneR);
     136      newSolutions.Add(oneR);
    138137      try {
    139138        var lda = LinearDiscriminantAnalysis.CreateLinearDiscriminantAnalysisSolution(problemData);
    140139        lda.Name = "Linear Discriminant Analysis Solution";
    141         solutions.Add(lda);
     140        newSolutions.Add(lda);
    142141      }
    143142      catch (NotSupportedException) { }
    144143      catch (ArgumentException) { }
    145       return solutions;
     144      return newSolutions;
    146145    }
    147146
Note: See TracChangeset for help on using the changeset viewer.