public PMMLClassifier getClassifier(String name) { PMMLClassifier regression = null; try { PMMLModel model = PMMLFactory.getPMMLModel(new BufferedInputStream(ClassLoader.getSystemResourceAsStream( "weka/classifiers/pmml/data/" + name))); regression = (PMMLClassifier)model; } catch (Exception ex) { ex.printStackTrace(); } return regression; }
public PMMLClassifier getClassifier(String name) { PMMLClassifier regression = null; try { PMMLModel model = PMMLFactory.getPMMLModel(new BufferedInputStream( ClassLoader.getSystemResourceAsStream("weka/classifiers/pmml/data/" + name))); regression = (PMMLClassifier) model; } catch (Exception ex) { ex.printStackTrace(); } return regression; }
/** * Set the log to pass on to the model. Only PMML models require logging. * * @param log the log to use */ public void setLog(LogChannelInterface log) { if (getModel() instanceof PMMLModel) { LogAdapter logger = new LogAdapter(log); ((PMMLModel) getModel()).setLog(logger); } }