- Timestamp:
- 03/26/09 11:02:09 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Core/Results.cs
r1424 r1426 65 65 } 66 66 } 67 68 private Dictionary<string, Dictionary<object, double>> categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>(); 67 69 68 70 private Entity dataSetEntity; … … 139 141 140 142 public double IndexOfCategoricalValue(string variable, object value) { 141 return 1.0; // TODO 143 if (value == null) return double.NaN; 144 Dictionary<object, double> valueToIndexMap; 145 if (categoricalValueIndices.ContainsKey(variable)) { 146 valueToIndexMap = categoricalValueIndices[variable]; 147 } else { 148 valueToIndexMap = new Dictionary<object, double>(); 149 categoricalValueIndices[variable] = valueToIndexMap; 150 } 151 if (!valueToIndexMap.ContainsKey(value)) { 152 if (valueToIndexMap.Values.Count == 0) valueToIndexMap[value] = 1.0; 153 else valueToIndexMap[value] = 1.0 + valueToIndexMap.Values.Max(); 154 } 155 return valueToIndexMap[value]; 142 156 } 143 157 }
Note: See TracChangeset
for help on using the changeset viewer.