|
|||||||||
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.MLkNN
public class MLkNN
Class implementing the ML-kNN (Multi-Label k Nearest Neighbours) algorithm.
For more information, see
Min-Ling Zhang, Zhi-Hua Zhou (2007). ML-KNN: A lazy learning approach to multi-label learning. Pattern Recogn.. 40(7):2038--2048.
@article{Zhang2007, address = {New York, NY, USA}, author = {Min-Ling Zhang and Zhi-Hua Zhou}, journal = {Pattern Recogn.}, number = {7}, pages = {2038--2048}, publisher = {Elsevier Science Inc.}, title = {ML-KNN: A lazy learning approach to multi-label learning}, volume = {40}, year = {2007}, ISSN = {0031-3203} }
Field Summary | |
---|---|
protected double |
smooth
Smoothing parameter controlling the strength of uniform prior (Default value is set to 1 which yields the Laplace smoothing). |
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 | |
---|---|
MLkNN()
The default constructor |
|
MLkNN(int numOfNeighbors,
double smooth)
|
Method Summary | |
---|---|
protected void |
buildInternal(MultiLabelInstances train)
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 MultiLabelOutput |
makePredictionInternal(Instance instance)
Learner specific implementation for predicting on specified data based on trained model. |
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 |
Field Detail |
---|
protected double smooth
Constructor Detail |
---|
public MLkNN(int numOfNeighbors, double smooth)
numOfNeighbors
- : the number of neighborssmooth
- : the smoothing factorpublic MLkNN()
Method Detail |
---|
public String globalInfo()
MultiLabelLearnerBase
globalInfo
in class MultiLabelLearnerBase
public TechnicalInformation getTechnicalInformation()
MultiLabelLearnerBase
getTechnicalInformation
in interface TechnicalInformationHandler
getTechnicalInformation
in class MultiLabelLearnerBase
protected void buildInternal(MultiLabelInstances train) 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
train
- the training data set
Exception
- if learner model was not created successfullyprotected 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 learner
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |