Package cc.mallet.types
Class RankedFeatureVector
- java.lang.Object
-
- cc.mallet.types.SparseVector
-
- cc.mallet.types.FeatureVector
-
- cc.mallet.types.RankedFeatureVector
-
- All Implemented Interfaces:
AlphabetCarrying,ConstantMatrix,Vector,java.io.Serializable
- Direct Known Subclasses:
BiNormalSeparation,ExpGain,FeatureCounts,GainRatio,GradientGain,InfoGain,KLGain,LabelVector,PartiallyRankedFeatureVector
public class RankedFeatureVector extends FeatureVector
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRankedFeatureVector.Factorystatic interfaceRankedFeatureVector.PerLabelFactory
-
Field Summary
-
Fields inherited from class cc.mallet.types.SparseVector
hasInfinite, indices, values
-
-
Constructor Summary
Constructors Constructor Description RankedFeatureVector(Alphabet dict, double[] values)RankedFeatureVector(Alphabet dict, double[] values, int begin, int length)RankedFeatureVector(Alphabet dict, int[] indices, double[] values)RankedFeatureVector(Alphabet dict, AugmentableFeatureVector v)RankedFeatureVector(Alphabet dict, DenseVector v)RankedFeatureVector(Alphabet dict, SparseVector v)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIndexAtRank(int rank)doublegetMaxValue()intgetMaxValuedIndex()intgetMaxValuedIndexIn(FeatureSelection fs)java.lang.ObjectgetMaxValuedObject()java.lang.ObjectgetMaxValuedObjectIn(FeatureSelection fs)doublegetMaxValueIn(FeatureSelection fs)java.lang.ObjectgetObjectAtRank(int rank)intgetRank(int index)intgetRank(java.lang.Object o)doublegetValueAtRank(int rank)voidprintByRank(java.io.OutputStream out)Prints a human-readable version of this vector, with features listed in ranked order.voidprintByRank(java.io.PrintWriter out)Prints a human-readable version of this vector, with features listed in ranked order.voidprintLowerK(java.io.PrintWriter out, int num)voidprintTopK(java.io.PrintWriter out, int num)voidset(int i, double v)protected voidsetRankOrder()Add rank annotations for the entire feature vector.protected voidsetRankOrder(int extent)protected voidsetRankOrder(int extent, boolean reset)protected voidsetReverseRankOrder(int extent, boolean reset)-
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
-
-
-
-
Constructor Detail
-
RankedFeatureVector
public RankedFeatureVector(Alphabet dict, int[] indices, double[] values)
-
RankedFeatureVector
public RankedFeatureVector(Alphabet dict, double[] values)
-
RankedFeatureVector
public RankedFeatureVector(Alphabet dict, double[] values, int begin, int length)
-
RankedFeatureVector
public RankedFeatureVector(Alphabet dict, DenseVector v)
-
RankedFeatureVector
public RankedFeatureVector(Alphabet dict, AugmentableFeatureVector v)
-
RankedFeatureVector
public RankedFeatureVector(Alphabet dict, SparseVector v)
-
-
Method Detail
-
setRankOrder
protected void setRankOrder()
Add rank annotations for the entire feature vector.
-
setRankOrder
protected void setRankOrder(int extent, boolean reset)
-
setReverseRankOrder
protected void setReverseRankOrder(int extent, boolean reset)
-
setRankOrder
protected void setRankOrder(int extent)
-
getMaxValuedIndex
public int getMaxValuedIndex()
-
getMaxValuedObject
public java.lang.Object getMaxValuedObject()
-
getMaxValuedIndexIn
public int getMaxValuedIndexIn(FeatureSelection fs)
-
getMaxValuedObjectIn
public java.lang.Object getMaxValuedObjectIn(FeatureSelection fs)
-
getMaxValue
public double getMaxValue()
-
getMaxValueIn
public double getMaxValueIn(FeatureSelection fs)
-
getIndexAtRank
public int getIndexAtRank(int rank)
-
getObjectAtRank
public java.lang.Object getObjectAtRank(int rank)
-
getValueAtRank
public double getValueAtRank(int rank)
-
printByRank
public void printByRank(java.io.OutputStream out)
Prints a human-readable version of this vector, with features listed in ranked order.- Parameters:
out- Stream to write to
-
printByRank
public void printByRank(java.io.PrintWriter out)
Prints a human-readable version of this vector, with features listed in ranked order.- Parameters:
out- Writer to write to
-
printTopK
public void printTopK(java.io.PrintWriter out, int num)
-
printLowerK
public void printLowerK(java.io.PrintWriter out, int num)
-
getRank
public int getRank(java.lang.Object o)
-
getRank
public int getRank(int index)
-
set
public void set(int i, double v)
-
-