/** * Signify that this batch of input to the filter is finished. * * @return true if there are instances pending output * @throws Exception if something goes wrong */ @Override public boolean batchFinished() throws Exception { return m_attributeFilter.batchFinished(); }
/** * Signify that this batch of input to the filter is finished. * * @return true if there are instances pending output * @throws Exception if something goes wrong */ @Override public boolean batchFinished() throws Exception { return m_attributeFilter.batchFinished(); }
/** * reduce the dimensionality of a single instance to include only those * attributes chosen by the last run of attribute selection. * * @param in the instance to be reduced * @return a dimensionality reduced instance * @exception Exception if the instance can't be reduced */ public Instance reduceDimensionality(Instance in) throws Exception { if (m_attributeFilter == null) { throw new Exception("No feature selection has been performed yet!"); } if (m_transformer != null) { in = m_transformer.convertInstance(in); } m_attributeFilter.input(in); m_attributeFilter.batchFinished(); Instance result = m_attributeFilter.output(); return result; }
/** * reduce the dimensionality of a single instance to include only those * attributes chosen by the last run of attribute selection. * * @param in the instance to be reduced * @return a dimensionality reduced instance * @exception Exception if the instance can't be reduced */ public Instance reduceDimensionality(Instance in) throws Exception { if (m_attributeFilter == null) { throw new Exception("No feature selection has been performed yet!"); } if (m_transformer != null) { in = m_transformer.convertInstance(in); } m_attributeFilter.input(in); m_attributeFilter.batchFinished(); Instance result = m_attributeFilter.output(); return result; }
protected MultiLabelOutput makePredictionInternal(Instance instance) throws Exception { double[] confidences = new double[numLabels]; boolean[] labels = new boolean[numLabels]; // gather votes for (int i = 0; i < numOfModels; i++) { remove[i].input(instance); remove[i].batchFinished(); Instance newInstance = remove[i].output(); MultiLabelOutput subsetMLO = subsetClassifiers[i].makePrediction(newInstance); boolean[] localPredictions = subsetMLO.getBipartition(); double[] localConfidences = subsetMLO.getConfidences(); for (int j = 0; j < classIndicesPerSubset_d[i].size(); j++) { labels[classIndicesPerSubset_d[i].get(j)] = localPredictions[j]; confidences[classIndicesPerSubset_d[i].get(j)] = localConfidences[j]; } } MultiLabelOutput mlo = new MultiLabelOutput(labels, confidences); return mlo; }
} else { // Prediction for multi label splits remove[i].input(instance); remove[i].batchFinished(); Instance newInstance = remove[i].output(); MLO[multiSplitNo] = multiLabelLearners.get(multiSplitNo).makePrediction(newInstance);
inst = source.nextElement(train); removeClass.input(inst); removeClass.batchFinished(); Instance clusterTrainInst = removeClass.output(); ((UpdateableClusterer) clusterer).updateClusterer(clusterTrainInst);
m_delTransform.batchFinished(); Instance dtInstance = m_delTransform.output();
inst = source.nextElement(train); removeClass.input(inst); removeClass.batchFinished(); Instance clusterTrainInst = removeClass.output(); ((UpdateableClusterer) clusterer).updateClusterer(clusterTrainInst);
remove[i].batchFinished(); Instance newInstance = remove[i].output(); MultiLabelOutput subsetMLO = subsetClassifiers[i].makePrediction(newInstance);
m_delTransform.batchFinished(); instance = m_delTransform.output();
m_delTransform.batchFinished(); instance = m_delTransform.output();
m_removeFilter.input(toFilter.instance(i)); m_removeFilter.batchFinished();
m_removeFilter.input(toFilter.instance(i)); m_removeFilter.batchFinished();
m_attributeFilter.batchFinished(); tempInst = m_attributeFilter.output();
m_attributeFilter.batchFinished(); tempInst = m_attributeFilter.output();
m_AttributeFilter.batchFinished(); tempInst = m_AttributeFilter.output();
m_AttributeFilter.batchFinished(); tempInst = m_AttributeFilter.output();