@Test public void testMakeCopy() throws Exception { MultiLabelLearnerBase learner = getLearner(); String trainDatasetPath = path + "emotions-train.arff"; String testDatasetPath = path + "emotions-test.arff"; String xmlLabelsDefFilePath = path + "emotions.xml"; MultiLabelInstances trainDataSet = new MultiLabelInstances(trainDatasetPath, xmlLabelsDefFilePath); MultiLabelInstances testDataSet = new MultiLabelInstances(testDatasetPath, xmlLabelsDefFilePath); learner.build(trainDataSet); MultiLabelLearnerBase copy = (MultiLabelLearnerBase) learner.makeCopy(); for (int i = 0; i < testDataSet.getDataSet().numInstances(); i++) { MultiLabelOutput mlo1 = learner.makePrediction(testDataSet.getDataSet().instance(i)); MultiLabelOutput mlo2 = copy.makePrediction(testDataSet.getDataSet().instance(i)); Assert.assertEquals(mlo1, mlo2); } }
public MultiLabelLearner makeCopy() throws Exception { return (MultiLabelLearner) new SerializedObject(this).getObject(); }
MultiLabelLearnerBase implements TechnicalInformationHandler, MultiLabelLearner, Serializable { public MultiLabelLearner makeCopy() throws Exception { return (MultiLabelLearner) new SerializedObject(this).getObject(); } }
MultiLabelLearnerBase implements TechnicalInformationHandler, MultiLabelLearner, Serializable { public MultiLabelLearner makeCopy() throws Exception { return (MultiLabelLearner) new SerializedObject(this).getObject(); }  }
MultiLabelLearnerBase implements TechnicalInformationHandler, MultiLabelLearner, Serializable { public MultiLabelLearner makeCopy() throws Exception { return (MultiLabelLearner) new SerializedObject(this).getObject(); }  boolean isUpdatable(); final void build(MultiLabelInstances trainingSet); final MultiLabelOutput makePrediction(Instance instance); void setDebug(boolean debug); boolean getDebug(); MultiLabelLearner makeCopy(); abstract TechnicalInformation getTechnicalInformation(); }
MultiLabelLearnerBase implements TechnicalInformationHandler, MultiLabelLearner, Serializable { public MultiLabelLearner makeCopy() throws Exception { return (MultiLabelLearner) new SerializedObject(this).getObject(); }  boolean isUpdatable(); final void build(MultiLabelInstances trainingSet); final MultiLabelOutput makePrediction(Instance instance); void setDebug(boolean debug); boolean getDebug(); MultiLabelLearner makeCopy(); abstract TechnicalInformation getTechnicalInformation();  }