|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mulan.classifier.MultiLabelLearnerBase mulan.classifier.transformation.TransformationBasedMultiLabelLearner mulan.classifier.transformation.MultiLabelStacking
public class MultiLabelStacking
This class is an implementation of the (BR)^2 or Multi-Label stacking method.
For more information, see
Grigorios Tsoumakas, Anastasios Dimou, Eleftherios Spyromitros, Vasileios Mezaris, Ioannis Kompatsiaris, Ioannis Vlahavas: Correlation-Based Pruning of Stacked Binary Relevance Models for Multi-Label Learning. In: Proc. ECML/PKDD 2009 Workshop on Learning from Multi-Label Data (MLD'09), 101-116, 2009.
@inproceedings{GrigoriosTsoumakas2009, author = {Grigorios Tsoumakas, Anastasios Dimou, Eleftherios Spyromitros, Vasileios Mezaris, Ioannis Kompatsiaris, Ioannis Vlahavas}, booktitle = {Proc. ECML/PKDD 2009 Workshop on Learning from Multi-Label Data (MLD'09)}, pages = {101-116}, title = {Correlation-Based Pruning of Stacked Binary Relevance Models for Multi-Label Learning}, year = {2009}, location = {Bled, Slovenia} }
Field Summary | |
---|---|
protected Instances |
train
the training instances |
Fields inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner |
---|
baseClassifier |
Fields inherited from class mulan.classifier.MultiLabelLearnerBase |
---|
featureIndices, labelIndices, numLabels |
Constructor Summary | |
---|---|
MultiLabelStacking()
An empty constructor |
|
MultiLabelStacking(Classifier baseClassifier,
Classifier metaClassifier)
A constructor with 2 arguments |
Method Summary | |
---|---|
protected Instances |
attachIndexes(Instances original)
Attaches an index attribute at the beginning of each instance |
void |
buildBaseLevel(MultiLabelInstances trainingSet)
Builds the base-level classifiers. |
void |
buildBaseLevelKNN(MultiLabelInstances trainingSet)
Used only in case of a kNN base classifier. |
protected void |
buildInternal(MultiLabelInstances dataSet)
Learner specific implementation of building the model from MultiLabelInstances
training data set. |
void |
buildMetaLevel()
Builds the ensemble of meta-level classifiers. |
protected Instances |
detachIndexes(Instances original)
Detaches the index attribute from the beginning of each instance |
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on. |
int |
getTopkCorrelated()
Returns top k correlated labels |
String |
globalInfo()
Returns a string describing the classifier. |
void |
initializeMetaLevel(MultiLabelInstances dataSet,
Classifier metaClassifier,
boolean includeAttrs,
double metaPercentage,
ASEvaluation eval)
Initializes all the parameters used in the meta-level. |
protected MultiLabelOutput |
makePredictionInternal(Instance instance)
Learner specific implementation for predicting on specified data based on trained model. |
void |
saveObject(String filename)
Saves a MultiLabelStacking object in a file |
void |
setEval(ASEvaluation eval)
Sets the attribute selection evaluation class |
void |
setIncludeAttrs(boolean includeAttrs)
Sets the value of includeAttrs |
void |
setMetaAlgorithm(Classifier metaClassifier)
Sets the type of the meta classifier and initializes the ensemble |
void |
setMetaPercentage(double metaPercentage)
Sets the value of metaPercentage |
void |
setNormalize(boolean normalize)
Sets the value of normalize |
void |
setPartialBuild(boolean partialBuild)
sets the value for partialBuild |
Methods inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner |
---|
getBaseClassifier |
Methods inherited from class mulan.classifier.MultiLabelLearnerBase |
---|
build, debug, getDebug, isModelInitialized, isUpdatable, makeCopy, makePrediction, setDebug |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Instances train
Constructor Detail |
---|
public MultiLabelStacking()
public MultiLabelStacking(Classifier baseClassifier, Classifier metaClassifier)
baseClassifier
- the classifier used in the base-levelmetaClassifier
- the classifier used in the meta-levelMethod Detail |
---|
public String globalInfo()
globalInfo
in class TransformationBasedMultiLabelLearner
public TechnicalInformation getTechnicalInformation()
TransformationBasedMultiLabelLearner
getTechnicalInformation
in interface TechnicalInformationHandler
getTechnicalInformation
in class TransformationBasedMultiLabelLearner
protected void buildInternal(MultiLabelInstances dataSet) throws Exception
MultiLabelLearnerBase
MultiLabelInstances
training data set. This method is called from MultiLabelLearnerBase.build(MultiLabelInstances)
method,
where behavior common across all learners is applied.
buildInternal
in class MultiLabelLearnerBase
dataSet
- the training data set
Exception
- if learner model was not created successfullypublic void initializeMetaLevel(MultiLabelInstances dataSet, Classifier metaClassifier, boolean includeAttrs, double metaPercentage, ASEvaluation eval) throws Exception
dataSet
- metaClassifier
- includeAttrs
- metaPercentage
- eval
-
Exception
public void buildBaseLevel(MultiLabelInstances trainingSet) throws Exception
trainingSet
-
Exception
public void buildMetaLevel() throws Exception
Exception
public void buildBaseLevelKNN(MultiLabelInstances trainingSet) throws Exception
trainingSet
-
Exception
protected MultiLabelOutput makePredictionInternal(Instance instance) throws Exception
MultiLabelLearnerBase
MultiLabelLearnerBase.makePrediction(weka.core.Instance)
which guards for model
initialization and apply common handling/behavior.
makePredictionInternal
in class MultiLabelLearnerBase
instance
- the data instance to predict on
Exception
- if an error occurs while making the prediction.
InvalidDataException
- if specified instance data is invalid and can not be processed by the learnerprotected Instances attachIndexes(Instances original)
original
-
protected Instances detachIndexes(Instances original) throws Exception
original
-
Exception
public void saveObject(String filename)
MultiLabelStacking
object in a file
filename
- public void setNormalize(boolean normalize)
normalize
- public void setIncludeAttrs(boolean includeAttrs)
includeAttrs
- public void setMetaPercentage(double metaPercentage)
metaPercentage
- public void setEval(ASEvaluation eval)
eval
- public void setMetaAlgorithm(Classifier metaClassifier) throws Exception
metaClassifier
-
Exception
public void setPartialBuild(boolean partialBuild)
partialBuild
- public int getTopkCorrelated()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |