private MLMethod obtainMethod() {
final String resourceID = getProp().getPropertyString(
ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);
final File resourceFile = getScript().resolveFilename(resourceID);
final MLMethod method = (MLMethod) EncogDirectoryPersistence
.loadObject(resourceFile);
if (!(method instanceof MLMethod)) {
throw new AnalystError(
"The object to be trained must be an instance of MLMethod. "
+ method.getClass().getSimpleName());
}
return method;
}