NormalizationAction action;
final boolean isLast = i == this.script.getFields().length - 1;
if( (this.methodType == WizardMethodType.EPL ) || (this.methodType == WizardMethodType.BayesianNetwork) ) {
AnalystField af;
if (f.isClass()) {
af = new AnalystField(f.getName(),
NormalizationAction.SingleField, 0, 0);
} else {
af = new AnalystField(f.getName(),
NormalizationAction.PassThrough, 0, 0);
}
norm.add(af);
} else if ((f.isInteger() || f.isReal()) && !f.isClass()) {
action = NormalizationAction.Normalize;
AnalystField af;
if (this.range == NormalizeRange.NegOne2One) {
af = new AnalystField(f.getName(), action, 1, -1);
} else {
af = new AnalystField(f.getName(), action, 1, 0);
}
norm.add(af);
af.setActualHigh(f.getMax());
af.setActualLow(f.getMin());
} else if (f.isClass()) {
if (isLast && this.directClassification) {
action = NormalizationAction.SingleField;
} else if (f.getClassMembers().size() > 2) {
action = NormalizationAction.Equilateral;
} else {
action = NormalizationAction.OneOf;
}
if (this.range == NormalizeRange.NegOne2One) {
norm.add(new AnalystField(f.getName(), action, 1, -1));
} else {
norm.add(new AnalystField(f.getName(), action, 1, 0));
}
} else {
action = NormalizationAction.Ignore;
norm.add(new AnalystField(action, f.getName()));
}
}
this.script.getNormalize().init(this.script);
}