}
}
}
if (!success) {
throw new AnalystError(
"Can't determine target field automatically, "
+ "please specify one.\nThis can also happen if you "
+ "specified the wrong file format.\nNote: If your file has no headers, specify \"field:1\" - \"field:n\".");
}
} else {
this.targetField = this.script
.findAnalystField(this.targetFieldName);
if (this.targetField == null) {
throw new AnalystError("Invalid target field: "
+ this.targetField);
}
}
this.script.getProperties().setProperty(
ScriptProperties.DATA_CONFIG_GOAL, this.goal);
if (!this.timeSeries && this.taskBalance) {
this.script.getProperties().setProperty(
ScriptProperties.BALANCE_CONFIG_BALANCE_FIELD,
this.targetField.getName());
final DataField field = this.analyst.getScript().findDataField(
this.targetField.getName());
if ((field != null) && field.isClass()) {
final int countPer = field.getMinClassCount();
this.script.getProperties().setProperty(
ScriptProperties.BALANCE_CONFIG_COUNT_PER, countPer);
} else {
throw new AnalystError("Balance currently may only be used on a nominal/class field, not a numeric field.");
}
}
// determine output field
if (this.methodType != WizardMethodType.BayesianNetwork) {