Package cc.mallet.types
Class LabelVector
- java.lang.Object
-
- cc.mallet.types.SparseVector
-
- cc.mallet.types.FeatureVector
-
- cc.mallet.types.RankedFeatureVector
-
- cc.mallet.types.LabelVector
-
- All Implemented Interfaces:
AlphabetCarrying
,ConstantMatrix
,Labeling
,Vector
,java.io.Serializable
public class LabelVector extends RankedFeatureVector implements Labeling
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class cc.mallet.types.RankedFeatureVector
RankedFeatureVector.Factory, RankedFeatureVector.PerLabelFactory
-
-
Field Summary
-
Fields inherited from class cc.mallet.types.SparseVector
hasInfinite, indices, values
-
-
Constructor Summary
Constructors Constructor Description LabelVector(Label[] labels, double[] values)
LabelVector(LabelAlphabet dict, double[] values)
LabelVector(LabelAlphabet dict, int[] features, double[] values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBestIndex()
Label
getBestLabel()
double
getBestValue()
LabelAlphabet
getLabelAlphabet()
Label
getLabelAtRank(int rank)
int
getRank(int labelIndex)
int
getRank(Label label)
double
getValueAtRank(int rank)
Label
labelAtLocation(int loc)
LabelVector
toLabelVector()
double
value(Label label)
-
Methods inherited from class cc.mallet.types.RankedFeatureVector
getIndexAtRank, getMaxValue, getMaxValuedIndex, getMaxValuedIndexIn, getMaxValuedObject, getMaxValuedObjectIn, getMaxValueIn, getObjectAtRank, getRank, printByRank, printByRank, printLowerK, printTopK, set, setRankOrder, setRankOrder, setRankOrder, setReverseRankOrder
-
Methods inherited from class cc.mallet.types.FeatureVector
alphabetsMatch, cloneMatrix, cloneMatrixZeroed, contains, getAlphabet, getAlphabets, getObjectIndices, location, newFeatureVector, toSimpFile, toString, toString, value
-
Methods inherited from class cc.mallet.types.SparseVector
absNorm, addTo, addTo, arrayCopyFrom, arrayCopyFrom, arrayCopyInto, dotProduct, dotProduct, dotProduct, dotProduct, extendedDotProduct, extendedDotProduct, getDimensions, getIndices, getNumDimensions, getValues, incrementValue, indexAtLocation, infinityNorm, isBinary, isInfinite, isNaN, isNaNOrInfinite, location, makeBinary, makeNonBinary, map, numLocations, oneNorm, plusEqualsSparse, plusEqualsSparse, print, removeDuplicates, setAll, setValue, setValueAtLocation, singleIndex, singleSize, singleToIndices, singleValue, sortIndices, timesEquals, timesEqualsSparse, timesEqualsSparse, timesEqualsSparseZero, twoNorm, value, value, valueAtLocation, vectorAdd
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cc.mallet.types.AlphabetCarrying
getAlphabet, getAlphabets
-
Methods inherited from interface cc.mallet.types.Labeling
addTo, addTo, indexAtLocation, numLocations, value, valueAtLocation
-
-
-
-
Constructor Detail
-
LabelVector
public LabelVector(LabelAlphabet dict, int[] features, double[] values)
-
LabelVector
public LabelVector(Label[] labels, double[] values)
-
LabelVector
public LabelVector(LabelAlphabet dict, double[] values)
-
-
Method Detail
-
labelAtLocation
public final Label labelAtLocation(int loc)
- Specified by:
labelAtLocation
in interfaceLabeling
-
getLabelAlphabet
public LabelAlphabet getLabelAlphabet()
- Specified by:
getLabelAlphabet
in interfaceLabeling
-
getBestIndex
public int getBestIndex()
- Specified by:
getBestIndex
in interfaceLabeling
-
getBestLabel
public Label getBestLabel()
- Specified by:
getBestLabel
in interfaceLabeling
-
getBestValue
public double getBestValue()
- Specified by:
getBestValue
in interfaceLabeling
-
getRank
public int getRank(int labelIndex)
- Specified by:
getRank
in interfaceLabeling
- Overrides:
getRank
in classRankedFeatureVector
-
getLabelAtRank
public Label getLabelAtRank(int rank)
- Specified by:
getLabelAtRank
in interfaceLabeling
-
getValueAtRank
public double getValueAtRank(int rank)
- Specified by:
getValueAtRank
in interfaceLabeling
- Overrides:
getValueAtRank
in classRankedFeatureVector
-
toLabelVector
public LabelVector toLabelVector()
- Specified by:
toLabelVector
in interfaceLabeling
-
-