|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mulan.classifier.MultiLabelLearnerBase mulan.classifier.lazy.MultiLabelKNN mulan.classifier.lazy.BRkNN
public class BRkNN
Simple BR implementation of the KNN algorithm.For more information, see
Eleftherios Spyromitros, Grigorios Tsoumakas, Ioannis Vlahavas: An Empirical Study of Lazy Multilabel Classification Algorithms. In: Proc. 5th Hellenic Conference on Artificial Intelligence (SETN 2008), 2008.
@inproceedings{EleftheriosSpyromitros2008, author = {Eleftherios Spyromitros, Grigorios Tsoumakas, Ioannis Vlahavas}, booktitle = {Proc. 5th Hellenic Conference on Artificial Intelligence (SETN 2008)}, title = {An Empirical Study of Lazy Multilabel Classification Algorithms}, year = {2008}, location = {Syros, Greece} }
Nested Class Summary | |
---|---|
static class |
BRkNN.ExtensionType
The two types of extensions |
Field Summary |
---|
Fields inherited from class mulan.classifier.lazy.MultiLabelKNN |
---|
dfunc, distanceWeighting, lnn, numOfNeighbors, train, WEIGHT_INVERSE, WEIGHT_NONE, WEIGHT_SIMILARITY |
Fields inherited from class mulan.classifier.MultiLabelLearnerBase |
---|
featureIndices, labelIndices, numLabels |
Constructor Summary | |
---|---|
BRkNN()
Default constructor |
|
BRkNN(int numOfNeighbors)
A constructor that sets the number of neighbors |
|
BRkNN(int numOfNeighbors,
BRkNN.ExtensionType ext)
Constructor giving the option to select an extension of the base version |
Method Summary | |
---|---|
protected void |
buildInternal(MultiLabelInstances aTrain)
Learner specific implementation of building the model from MultiLabelInstances
training data set. |
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. |
String |
globalInfo()
Returns a string describing the multi-label learner. |
protected boolean[] |
labelsFromConfidences2(double[] confidences)
used for BRknn-a |
protected boolean[] |
labelsFromConfidences3(double[] confidences)
used for BRkNN-b (break ties arbitrarily) |
protected MultiLabelOutput |
makePredictionInternal(Instance instance)
weka Ibk style prediction |
void |
setCvMaxK(int cvMaxK)
set the maximum number of neighbors to be evaluated via cross-validation |
void |
setkSelectionViaCV(boolean flag)
|
Methods inherited from class mulan.classifier.lazy.MultiLabelKNN |
---|
isUpdatable, setDfunc, setDistanceWeighting |
Methods inherited from class mulan.classifier.MultiLabelLearnerBase |
---|
build, debug, getDebug, isModelInitialized, makeCopy, makePrediction, setDebug |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BRkNN()
public BRkNN(int numOfNeighbors)
numOfNeighbors
- public BRkNN(int numOfNeighbors, BRkNN.ExtensionType ext)
numOfNeighbors
- ext
- the extension to use (see BRkNN.ExtensionType
)Method Detail |
---|
public TechnicalInformation getTechnicalInformation()
MultiLabelLearnerBase
getTechnicalInformation
in interface TechnicalInformationHandler
getTechnicalInformation
in class MultiLabelLearnerBase
protected void buildInternal(MultiLabelInstances aTrain) 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 MultiLabelKNN
aTrain
- the training data set
Exception
- if learner model was not created successfullypublic void setkSelectionViaCV(boolean flag)
flag
- if true the k is selected via cross-validationprotected MultiLabelOutput makePredictionInternal(Instance instance) throws Exception
makePredictionInternal
in class MultiLabelLearnerBase
instance
- the data instance to predict on
Exception
- if nearest neighbours search failsprotected boolean[] labelsFromConfidences2(double[] confidences)
confidences
- the probabilities for each label
protected boolean[] labelsFromConfidences3(double[] confidences)
confidences
- the probabilities for each label
public void setCvMaxK(int cvMaxK)
cvMaxK
- public String globalInfo()
MultiLabelLearnerBase
globalInfo
in class MultiLabelLearnerBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |