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:
- ExpGain, FeatureCounts, GainRatio, GradientGain, InfoGain, KLGain, LabelVector, PartiallyRankedFeatureVector
public class RankedFeatureVector
- extends FeatureVector
- See Also:
- Serialized Form
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 |
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)
setRankOrder
protected void setRankOrder()
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)