Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/05/12 11:58:17 (12 years ago)
Author:
mkommend
Message:

#1081: Merged trunk changes and fixed compilation errors due to the merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationSolutionBase.cs

    r8430 r8742  
    8585      Add(new Result(TrainingRSquaredResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the training partition", new DoubleValue()));
    8686      Add(new Result(TestRSquaredResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the test partition", new DoubleValue()));
    87 
    8887      RegisterEventHandler();
    8988    }
     
    9291    private void AfterDeserialization() {
    9392      RegisterEventHandler();
    94     }
    95 
    96     protected override void OnModelChanged() {
    97       DeregisterEventHandler();
    98       SetAccuracyMaximizingThresholds();
    99       RegisterEventHandler();
    100       base.OnModelChanged();
    10193    }
    10294
     
    137129    }
    138130
    139     public void SetAccuracyMaximizingThresholds() {
    140       double[] classValues;
    141       double[] thresholds;
    142       var targetClassValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices);
    143       AccuracyMaximizationThresholdCalculator.CalculateThresholds(ProblemData, EstimatedTrainingValues, targetClassValues, out classValues, out thresholds);
    144 
    145       Model.SetThresholdsAndClassValues(thresholds, classValues);
    146     }
    147 
    148     public void SetClassDistibutionCutPointThresholds() {
    149       double[] classValues;
    150       double[] thresholds;
    151       var targetClassValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices);
    152       NormalDistributionCutPointsThresholdCalculator.CalculateThresholds(ProblemData, EstimatedTrainingValues, targetClassValues, out classValues, out thresholds);
    153 
    154       Model.SetThresholdsAndClassValues(thresholds, classValues);
    155     }
    156 
    157131    protected virtual void OnModelThresholdsChanged(EventArgs e) {
    158       CalculateResults();
    159       CalculateRegressionResults();
     132      OnModelChanged();
    160133    }
    161134
     
    165138
    166139    public abstract IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows);
     140
     141    protected override void RecalculateResults() {
     142      base.RecalculateResults();
     143      CalculateRegressionResults();
     144    }
    167145  }
    168146}
Note: See TracChangeset for help on using the changeset viewer.