Changeset 8717


Ignore:
Timestamp:
10/02/12 11:59:41 (7 years ago)
Author:
mkommend
Message:

#1915: Corrected class names in classification penalties views. Additionally I corrected a bug regarding the copy constructor, as the penalties were reset before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r8716 r8717  
    283283      for (int i = 0; i < classificationProblemData.ClassNames.Count(); i++)
    284284        ClassNamesParameter.Value[i, 0] = classificationProblemData.ClassNames.ElementAt(i);
     285
     286      for (int i = 0; i < Classes; i++) {
     287        for (int j = 0; j < Classes; j++) {
     288          ClassificationPenaltiesParameter.Value[i, j] = classificationProblemData.GetClassificationPenalty(i, j);
     289        }
     290      }
    285291    }
    286292
     
    378384      ClassNamesParameter.Value.Reset += new EventHandler(Parameter_ValueChanged);
    379385      ClassNamesParameter.Value.ItemChanged += new EventHandler<EventArgs<int, int>>(Parameter_ValueChanged);
     386      ClassificationPenaltiesParameter.Value.ItemChanged += new EventHandler<EventArgs<int, int>>(Parameter_ValueChanged);
     387      ClassificationPenaltiesParameter.Value.Reset += new EventHandler(Parameter_ValueChanged);
    380388    }
    381389    private void DeregisterParameterEvents() {
     
    383391      ClassNamesParameter.Value.Reset -= new EventHandler(Parameter_ValueChanged);
    384392      ClassNamesParameter.Value.ItemChanged -= new EventHandler<EventArgs<int, int>>(Parameter_ValueChanged);
     393      ClassificationPenaltiesParameter.Value.ItemChanged -= new EventHandler<EventArgs<int, int>>(Parameter_ValueChanged);
     394      ClassificationPenaltiesParameter.Value.Reset -= new EventHandler(Parameter_ValueChanged);
    385395    }
    386396
     
    393403    private void Parameter_ValueChanged(object sender, EventArgs e) {
    394404      classNamesCache = null;
     405      ClassificationPenaltiesParameter.Value.RowNames = ClassNames.Select(name => "Actual " + name);
     406      ClassificationPenaltiesParameter.Value.ColumnNames = ClassNames.Select(name => "Estimated " + name);
    395407      OnChanged();
    396408    }
Note: See TracChangeset for help on using the changeset viewer.