Changeset 129 for trunk/CrossPare/src/de/ugoe/cs/cpdp/util
- Timestamp:
- 06/22/16 11:25:46 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/util/WekaUtils.java
r86 r129 37 37 } 38 38 } 39 40 /** 41 * Scaling value that moves the decimal point by 5 digets. 42 */ 43 public final static double SCALER = 10000.0d; 39 44 40 45 /** … … 151 156 return new DistChar(mean, std, min, max, data.numInstances()); 152 157 } 158 159 /** 160 * <p> 161 * Upscales the value of a single attribute. This is a workaround to get BayesNet running for 162 * all data. Works on a copy of the training data, i.e., leaves the original data untouched. 163 * </p> 164 * 165 * @param traindata 166 * data from which the attribute is upscaled. 167 * @param attributeIndex 168 * index of the attribute 169 * @return data with upscaled attribute 170 */ 171 public static Instances upscaleAttribute(Instances traindata, int attributeIndex) { 172 Instances traindataCopy = new Instances(traindata); 173 for (int i = 0; i < traindata.size(); i++) { 174 traindataCopy.get(i).setValue(attributeIndex, 175 traindata.get(i).value(attributeIndex) * SCALER); 176 } 177 return traindataCopy; 178 } 153 179 }
Note: See TracChangeset
for help on using the changeset viewer.