Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/10/11 16:27:48 (14 years ago)
Author:
gkronber
Message:

#1418 ported ROC, confusion matrix and discriminant function classification views and fixed bug in threshold calculation.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.cs

    r5642 r5664  
    3131using HeuristicLab.MainForm.WindowsForms;
    3232namespace HeuristicLab.Problems.DataAnalysis.Classification.Views {
    33   [View("ROC Curves View")]
    34   [Content(typeof(SymbolicClassificationSolution))]
    35   public partial class RocCurvesView : AsynchronousContentView {
     33  [View("Discriminant function classification solution ROC curves view")]
     34  [Content(typeof(IDiscriminantFunctionClassificationSolution))]
     35  public partial class DiscriminantFunctionClassificationRocCurvesView : AsynchronousContentView {
    3636    private const string xAxisTitle = "False Positive Rate";
    3737    private const string yAxisTitle = "True Positive Rate";
     
    4040    private Dictionary<string, List<ROCPoint>> cachedRocPoints;
    4141
    42     public RocCurvesView() {
     42    public DiscriminantFunctionClassificationRocCurvesView() {
    4343      InitializeComponent();
    4444
     
    6161    }
    6262
    63     public new SymbolicClassificationSolution Content {
    64       get { return (SymbolicClassificationSolution)base.Content; }
     63    public new IDiscriminantFunctionClassificationSolution Content {
     64      get { return (IDiscriminantFunctionClassificationSolution)base.Content; }
    6565      set { base.Content = value; }
    6666    }
     
    6868    protected override void RegisterContentEvents() {
    6969      base.RegisterContentEvents();
    70       Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
     70      Content.ModelChanged += new EventHandler(Content_ModelChanged);
    7171      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    7272    }
    7373    protected override void DeregisterContentEvents() {
    7474      base.DeregisterContentEvents();
    75       Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
     75      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    7676      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
    7777    }
    7878
    79     private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
     79    private void Content_ModelChanged(object sender, EventArgs e) {
    8080      UpdateChart();
    8181    }
     
    107107
    108108        double[] estimatedValues = Content.GetEstimatedValues(rows).ToArray();
    109         double[] targetClassValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable.Value, rows).ToArray();
     109        double[] targetClassValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable, rows).ToArray();
    110110        double minThreshold = estimatedValues.Min();
    111111        double maxThreshold = estimatedValues.Max();
     
    114114        maxThreshold += thresholdIncrement;
    115115
    116         List<double> classValues = Content.ProblemData.SortedClassValues.ToList();
     116        List<double> classValues = Content.ProblemData.ClassValues.OrderBy(x => x).ToList();
    117117
    118118        foreach (double classValue in classValues) {
Note: See TracChangeset for help on using the changeset viewer.