Changeset 9135 for branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR
- Timestamp:
- 01/09/13 16:27:12 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs
r9119 r9135 50 50 } 51 51 52 [Storable] 53 protected double missingValuesClass; 54 public double MissingValuesClass { 55 get { return missingValuesClass; } 56 } 57 52 58 [StorableConstructor] 53 59 protected OneRClassificationModel(bool deserializing) : base(deserializing) { } … … 60 66 public override IDeepCloneable Clone(Cloner cloner) { return new OneRClassificationModel(this, cloner); } 61 67 62 public OneRClassificationModel(string variable, double[] splits, double[] classes )68 public OneRClassificationModel(string variable, double[] splits, double[] classes, double missingValuesClass = double.NaN) 63 69 : base() { 64 70 if (splits.Length != classes.Length) { … … 73 79 this.splits = splits; 74 80 this.classes = classes; 81 this.missingValuesClass = missingValuesClass; 75 82 } 76 83 … … 85 92 Array.Sort(values, rowsArray); 86 93 int curSplit = 0, curIndex = 0; 94 while (curIndex < values.Length && Double.IsNaN(values[curIndex])) { 95 estimated[curIndex] = MissingValuesClass; 96 curIndex++; 97 } 87 98 while (curSplit < Splits.Length) { 88 99 while (curIndex < values.Length && Splits[curSplit] > values[curIndex]) {
Note: See TracChangeset
for help on using the changeset viewer.