/** * Emit the result from a sub process wrapper back up to whoever called us * * @param res The classifier result. */ @Override protected void _processResults(ClassifierResult res) { System.out.print( "SubProcessWrapper: Time(" + res.getTime() + ") Score(" + res.getScore() + ")"); String outputFilePrefix = mProperties.getProperty("modelOutputFilePrefix", null); if (outputFilePrefix != null) { try { if (res.getAttributeSelection() != null) { weka.core.SerializationHelper.write( outputFilePrefix + ".attributeselection", res.getAttributeSelection()); } else { File oldFile = new File(outputFilePrefix + ".attributeselection"); if (oldFile.exists()) oldFile.delete(); } weka.core.SerializationHelper.write(outputFilePrefix + ".model", res.getClassifier()); } catch (Exception e) { throw new RuntimeException(e); } } }