Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/09/13 16:27:12 (12 years ago)
Author:
sforsten
Message:

#1998:

  • OneR handles missing values separately
  • adapted OneRClassificationModelView to show the class of missing values
  • with a double-click on the row header in ClassificationSolutionComparisonView the selected solution opens in a new view
  • put a try catch block around linear discriminant analysis solution (it is only shown, if it doesn't throw an exception)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs

    r9119 r9135  
    5050    }
    5151
     52    [Storable]
     53    protected double missingValuesClass;
     54    public double MissingValuesClass {
     55      get { return missingValuesClass; }
     56    }
     57
    5258    [StorableConstructor]
    5359    protected OneRClassificationModel(bool deserializing) : base(deserializing) { }
     
    6066    public override IDeepCloneable Clone(Cloner cloner) { return new OneRClassificationModel(this, cloner); }
    6167
    62     public OneRClassificationModel(string variable, double[] splits, double[] classes)
     68    public OneRClassificationModel(string variable, double[] splits, double[] classes, double missingValuesClass = double.NaN)
    6369      : base() {
    6470      if (splits.Length != classes.Length) {
     
    7379      this.splits = splits;
    7480      this.classes = classes;
     81      this.missingValuesClass = missingValuesClass;
    7582    }
    7683
     
    8592      Array.Sort(values, rowsArray);
    8693      int curSplit = 0, curIndex = 0;
     94      while (curIndex < values.Length && Double.IsNaN(values[curIndex])) {
     95        estimated[curIndex] = MissingValuesClass;
     96        curIndex++;
     97      }
    8798      while (curSplit < Splits.Length) {
    8899        while (curIndex < values.Length && Splits[curSplit] > values[curIndex]) {
Note: See TracChangeset for help on using the changeset viewer.