|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.types.SparseVector cc.mallet.types.FeatureVector cc.mallet.types.AugmentableFeatureVector
public class AugmentableFeatureVector
Field Summary |
---|
Fields inherited from class cc.mallet.types.SparseVector |
---|
hasInfinite, indices, values |
Constructor Summary | |
---|---|
AugmentableFeatureVector(Alphabet dict)
|
|
AugmentableFeatureVector(Alphabet dict,
boolean binary)
|
|
AugmentableFeatureVector(Alphabet dict,
double[] values)
|
|
AugmentableFeatureVector(Alphabet dict,
double[] values,
int capacity)
|
|
AugmentableFeatureVector(Alphabet dict,
int[] indices,
double[] values,
int capacity)
|
|
AugmentableFeatureVector(Alphabet dict,
int[] indices,
double[] values,
int capacity,
boolean copy)
|
|
AugmentableFeatureVector(Alphabet dict,
int[] indices,
double[] values,
int capacity,
boolean copy,
boolean checkIndicesSorted)
|
|
AugmentableFeatureVector(Alphabet dict,
int[] indices,
double[] values,
int capacity,
int size,
boolean copy,
boolean checkIndicesSorted,
boolean removeDuplicates)
To make a binary vector, pass null for "values" |
|
AugmentableFeatureVector(Alphabet dict,
int capacity,
boolean binary)
|
|
AugmentableFeatureVector(Alphabet dict,
PropertyList pl,
boolean binary)
|
|
AugmentableFeatureVector(Alphabet dict,
PropertyList pl,
boolean binary,
boolean growAlphabet)
|
|
AugmentableFeatureVector(FeatureSequence fs,
boolean binary)
|
|
AugmentableFeatureVector(FeatureVector fv)
|
Method Summary | |
---|---|
void |
add(FeatureVector fv)
Adds all indices that are present in some other feature vector with value 1.0. |
void |
add(FeatureVector fv,
java.lang.String prefix)
Adds all features from some other feature vector with weight 1.0. |
void |
add(FeatureVector fv,
java.lang.String prefix,
boolean binary)
Adds all features from some other feature vector with weight 1.0. |
void |
add(int index)
|
void |
add(int index,
double value)
|
void |
add(java.lang.Object key,
double value)
|
void |
addTo(double[] accumulator)
|
void |
addTo(double[] accumulator,
double scale)
|
ConstantMatrix |
cloneMatrix()
CLONING |
ConstantMatrix |
cloneMatrixZeroed()
|
double |
dotProduct(AugmentableFeatureVector v)
|
double |
dotProduct(DenseVector v)
|
double |
dotProduct(SparseVector v)
|
int |
indexAtLocation(int location)
|
double |
infinityNorm()
|
int |
location(int index)
|
int |
numLocations()
|
double |
oneNorm()
|
void |
plusEquals(AugmentableFeatureVector v,
double factor)
|
void |
plusEquals(SparseVector v)
|
void |
plusEquals(SparseVector v,
double factor)
|
void |
print()
|
protected void |
removeDuplicates(int numDuplicates)
|
void |
setAll(double v)
Sets every present index in the vector to v. |
void |
setValue(int index,
double value)
Sets the value at the given index. |
void |
setValueAtLocation(int location,
double value)
Sets the value at the given location. |
int |
singleSize()
|
protected void |
sortIndices()
|
FeatureVector |
toFeatureVector()
|
SparseVector |
toSparseVector()
|
double |
twoNorm()
|
double |
value(int index)
|
double |
valueAtLocation(int location)
|
Methods inherited from class cc.mallet.types.FeatureVector |
---|
alphabetsMatch, contains, getAlphabet, getAlphabets, getObjectIndices, location, newFeatureVector, toSimpFile, toString, toString, value |
Methods inherited from class cc.mallet.types.SparseVector |
---|
absNorm, arrayCopyFrom, arrayCopyFrom, arrayCopyInto, dotProduct, dotProduct, extendedDotProduct, extendedDotProduct, getDimensions, getIndices, getNumDimensions, getValues, incrementValue, isBinary, isInfinite, isNaN, isNaNOrInfinite, makeBinary, makeNonBinary, map, plusEqualsSparse, plusEqualsSparse, singleIndex, singleToIndices, singleValue, timesEquals, timesEqualsSparse, timesEqualsSparse, timesEqualsSparseZero, value, vectorAdd |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AugmentableFeatureVector(Alphabet dict, int[] indices, double[] values, int capacity, int size, boolean copy, boolean checkIndicesSorted, boolean removeDuplicates)
public AugmentableFeatureVector(Alphabet dict, int[] indices, double[] values, int capacity, boolean copy, boolean checkIndicesSorted)
public AugmentableFeatureVector(Alphabet dict, int[] indices, double[] values, int capacity, boolean copy)
public AugmentableFeatureVector(Alphabet dict, int[] indices, double[] values, int capacity)
public AugmentableFeatureVector(Alphabet dict, double[] values, int capacity)
public AugmentableFeatureVector(Alphabet dict, double[] values)
public AugmentableFeatureVector(Alphabet dict, int capacity, boolean binary)
public AugmentableFeatureVector(Alphabet dict, boolean binary)
public AugmentableFeatureVector(Alphabet dict)
public AugmentableFeatureVector(FeatureVector fv)
public AugmentableFeatureVector(FeatureSequence fs, boolean binary)
public AugmentableFeatureVector(Alphabet dict, PropertyList pl, boolean binary, boolean growAlphabet)
public AugmentableFeatureVector(Alphabet dict, PropertyList pl, boolean binary)
Method Detail |
---|
public void add(FeatureVector fv)
public void add(FeatureVector fv, java.lang.String prefix)
fv
- A feature vector to add from. Its feature names must be Strings.prefix
- String to add when generating new feature namespublic void add(FeatureVector fv, java.lang.String prefix, boolean binary)
fv
- A feature vector to add from. Its feature names must be Strings.prefix
- String to add when generating new feature namesbinary
- true if fv is binarypublic void add(int index, double value)
public void add(java.lang.Object key, double value)
public void add(int index)
public final int numLocations()
numLocations
in interface ConstantMatrix
numLocations
in class SparseVector
public final int location(int index)
location
in interface ConstantMatrix
location
in class SparseVector
public final double valueAtLocation(int location)
valueAtLocation
in interface ConstantMatrix
valueAtLocation
in class SparseVector
public final int indexAtLocation(int location)
indexAtLocation
in interface ConstantMatrix
indexAtLocation
in class SparseVector
public final double value(int index)
value
in interface Vector
value
in class SparseVector
public final void addTo(double[] accumulator, double scale)
addTo
in class SparseVector
public final void addTo(double[] accumulator)
addTo
in class SparseVector
public final void setValue(int index, double value)
SparseVector
setValue
in class SparseVector
public final void setValueAtLocation(int location, double value)
SparseVector
setValueAtLocation
in class SparseVector
public ConstantMatrix cloneMatrix()
SparseVector
cloneMatrix
in interface ConstantMatrix
cloneMatrix
in class FeatureVector
public ConstantMatrix cloneMatrixZeroed()
cloneMatrixZeroed
in class FeatureVector
public int singleSize()
singleSize
in interface ConstantMatrix
singleSize
in class SparseVector
public SparseVector toSparseVector()
public FeatureVector toFeatureVector()
public double dotProduct(DenseVector v)
dotProduct
in class SparseVector
public final double dotProduct(SparseVector v)
dotProduct
in class SparseVector
public final double dotProduct(AugmentableFeatureVector v)
public void plusEquals(AugmentableFeatureVector v, double factor)
public void plusEquals(SparseVector v, double factor)
public void plusEquals(SparseVector v)
public void setAll(double v)
SparseVector
setAll
in class SparseVector
public double oneNorm()
oneNorm
in interface ConstantMatrix
oneNorm
in class SparseVector
public double twoNorm()
twoNorm
in interface ConstantMatrix
twoNorm
in class SparseVector
public double infinityNorm()
infinityNorm
in interface ConstantMatrix
infinityNorm
in class SparseVector
public void print()
print
in interface ConstantMatrix
print
in class SparseVector
protected void sortIndices()
sortIndices
in class SparseVector
protected void removeDuplicates(int numDuplicates)
removeDuplicates
in class SparseVector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |