throws ActivityProcessingException,
InvalidWekaOptionsException
{
if (mClassifierName == null)
{
throw new ActivityProcessingException(
new KeyValueUnknownException(CLASSIFIER_CLASS_NAME));
}
try
{
if(options == null || options == "")
options = DEFAULT_OPTIONS;
Class<? extends Classifier> classifierClass =
Class.forName(mClassifierName).asSubclass(Classifier.class);
Classifier classifier = classifierClass.newInstance();
String[] opt = weka.core.Utils.splitOptions(options);
((OptionHandler)classifier).setOptions(opt);
return classifier;
}
catch (Exception e)
{
if(e.getClass() == NumberFormatException.class)
throw new InvalidWekaOptionsException(e);
else
throw new ActivityProcessingException(e);
}
}