@Override protected void normalizeAttributes(Dataset Data) { for (BaseEntry entry : Data.getEntries()) { double[] attr = entry.getAttributes(); for (int i = 0; i < attr.length; i++) { attr[i] = attr[i] == 0 ? 0 : Scale / attr[i]; } entry.setAttributes(attr); } }
@Override protected void normalizeClassVariable(Dataset Data) { for (BaseEntry entry : Data.getEntries()) { if (entry.hasMeasurement()) { double x = entry.getMeasuredClass(); x = x == 0 ? 0.0 : Scale / x; entry.setMeasuredClass(x); } if (entry.hasPrediction()) { double x = entry.getPredictedClass(); x = x == 0 ? 0.0 : Scale / x; entry.setPredictedClass(x); } } }