Class AbstractErrorWeightedVoteMultiLabel
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.classifiers.rules.multilabel.core.voting.AbstractErrorWeightedVoteMultiLabel
-
- All Implemented Interfaces:
Serializable
,ErrorWeightedVoteMultiLabel
,MOAObject
- Direct Known Subclasses:
FirstHitVoteMultiLabel
,InverseErrorWeightedVoteMultiLabel
,UniformWeightedVoteMultiLabel
public abstract class AbstractErrorWeightedVoteMultiLabel extends AbstractMOAObject implements ErrorWeightedVoteMultiLabel
AbstractErrorWeightedVote class for weighted votes based on estimates of errors.- Version:
- $Revision: 1 $
- Author:
- João Duarte (jmduarte@inescporto.pt)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<double[]>
errors
protected int[]
outputAttributesCount
protected List<Prediction>
votes
protected Prediction
weightedVote
protected double[][]
weights
-
Constructor Summary
Constructors Constructor Description AbstractErrorWeightedVoteMultiLabel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addVote(Prediction vote, double[] error)
Adds a vote and the corresponding error for the computation of the weighted vote and respective weighted error.abstract Prediction
computeWeightedVote()
Computes the weighted vote.boolean
coversAllOutputs()
Check if vote has a value for each outputvoid
getDescription(StringBuilder sb, int indent)
Returns a string representation of this object.int
getNumberVotes()
The number of votes added so far.int
getNumberVotes(int outputAttribute)
The number of votes for a given output attribute.double[]
getOutputAttributesErrors()
Returns the weighted error.Prediction
getPrediction()
double
getWeightedError()
Returns the weighted error.double[][]
getWeights()
Return the weights error.-
Methods inherited from class moa.AbstractMOAObject
copy, copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.classifiers.rules.multilabel.core.voting.ErrorWeightedVoteMultiLabel
copy
-
-
-
-
Field Detail
-
votes
protected List<Prediction> votes
-
errors
protected List<double[]> errors
-
weights
protected double[][] weights
-
outputAttributesCount
protected int[] outputAttributesCount
-
weightedVote
protected Prediction weightedVote
-
-
Method Detail
-
addVote
public void addVote(Prediction vote, double[] error)
Description copied from interface:ErrorWeightedVoteMultiLabel
Adds a vote and the corresponding error for the computation of the weighted vote and respective weighted error.- Specified by:
addVote
in interfaceErrorWeightedVoteMultiLabel
- Parameters:
vote
- - a vote returned by a classifiererror
- - the error associated to the vote
-
computeWeightedVote
public abstract Prediction computeWeightedVote()
Description copied from interface:ErrorWeightedVoteMultiLabel
Computes the weighted vote. Also updates the weights of the votes.- Specified by:
computeWeightedVote
in interfaceErrorWeightedVoteMultiLabel
- Returns:
- the weighted vote
-
getWeightedError
public double getWeightedError()
Description copied from interface:ErrorWeightedVoteMultiLabel
Returns the weighted error.- Specified by:
getWeightedError
in interfaceErrorWeightedVoteMultiLabel
- Returns:
- the weighted error
-
getWeights
public double[][] getWeights()
Description copied from interface:ErrorWeightedVoteMultiLabel
Return the weights error.- Specified by:
getWeights
in interfaceErrorWeightedVoteMultiLabel
- Returns:
- the weights for each output attribute
-
getNumberVotes
public int getNumberVotes()
Description copied from interface:ErrorWeightedVoteMultiLabel
The number of votes added so far.- Specified by:
getNumberVotes
in interfaceErrorWeightedVoteMultiLabel
- Returns:
- the number of votes
-
getNumberVotes
public int getNumberVotes(int outputAttribute)
Description copied from interface:ErrorWeightedVoteMultiLabel
The number of votes for a given output attribute.- Specified by:
getNumberVotes
in interfaceErrorWeightedVoteMultiLabel
- Parameters:
outputAttribute
- the index of the output attribute- Returns:
- the number of votes
-
getOutputAttributesErrors
public double[] getOutputAttributesErrors()
Description copied from interface:ErrorWeightedVoteMultiLabel
Returns the weighted error.- Specified by:
getOutputAttributesErrors
in interfaceErrorWeightedVoteMultiLabel
- Returns:
- the weighted error for each output attribute
-
getDescription
public void getDescription(StringBuilder sb, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Specified by:
getDescription
in interfaceMOAObject
- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
getPrediction
public Prediction getPrediction()
- Specified by:
getPrediction
in interfaceErrorWeightedVoteMultiLabel
-
coversAllOutputs
public boolean coversAllOutputs()
Description copied from interface:ErrorWeightedVoteMultiLabel
Check if vote has a value for each output- Specified by:
coversAllOutputs
in interfaceErrorWeightedVoteMultiLabel
-
-