Changeset 2328 for trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassModeller.cs
- Timestamp:
- 09/03/09 15:00:23 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassModeller.cs
r2222 r2328 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 83 84 double[] row = new double[dataset.Columns]; 84 85 double targetValue = origDataset.GetValue(k, targetVariable); 85 if ( IsEqual(targetValue,classAValue)) {86 if (targetValue.IsAlmost(classAValue)) { 86 87 for (int l = 0; l < row.Length; l++) { 87 88 row[l] = origDataset.GetValue(k, l); … … 89 90 row[targetVariable] = 0; 90 91 rows.Add(row); 91 } else if ( IsEqual(targetValue,classBValue)) {92 } else if (targetValue.IsAlmost(classBValue)) { 92 93 for (int l = 0; l < row.Length; l++) { 93 94 row[l] = origDataset.GetValue(k, l); … … 102 103 double[] row = new double[dataset.Columns]; 103 104 double targetValue = origDataset.GetValue(k, targetVariable); 104 if ( IsEqual(targetValue,classAValue)) {105 if (targetValue.IsAlmost(classAValue)) { 105 106 for (int l = 0; l < row.Length; l++) { 106 107 row[l] = origDataset.GetValue(k, l); … … 108 109 row[targetVariable] = 0; 109 110 rows.Add(row); 110 } else if ( IsEqual(targetValue,classBValue)) {111 } else if (targetValue.IsAlmost(classBValue)) { 111 112 for (int l = 0; l < row.Length; l++) { 112 113 row[l] = origDataset.GetValue(k, l); … … 141 142 return null; 142 143 } 143 144 private bool IsEqual(double x, double y) {145 return Math.Abs(x - y) < EPSILON;146 }147 144 } 148 145 }
Note: See TracChangeset
for help on using the changeset viewer.