|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcc.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 names
public 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 binary
public 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 ConstantMatrixnumLocations in class SparseVectorpublic final int location(int index)
location in interface ConstantMatrixlocation in class SparseVectorpublic final double valueAtLocation(int location)
valueAtLocation in interface ConstantMatrixvalueAtLocation in class SparseVectorpublic final int indexAtLocation(int location)
indexAtLocation in interface ConstantMatrixindexAtLocation in class SparseVectorpublic final double value(int index)
value in interface Vectorvalue in class SparseVector
public final void addTo(double[] accumulator,
double scale)
addTo in class SparseVectorpublic 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 SparseVectorpublic ConstantMatrix cloneMatrix()
SparseVector
cloneMatrix in interface ConstantMatrixcloneMatrix in class FeatureVectorpublic ConstantMatrix cloneMatrixZeroed()
cloneMatrixZeroed in class FeatureVectorpublic int singleSize()
singleSize in interface ConstantMatrixsingleSize in class SparseVectorpublic SparseVector toSparseVector()
public FeatureVector toFeatureVector()
public double dotProduct(DenseVector v)
dotProduct in class SparseVectorpublic final double dotProduct(SparseVector v)
dotProduct in class SparseVectorpublic 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 SparseVectorpublic double oneNorm()
oneNorm in interface ConstantMatrixoneNorm in class SparseVectorpublic double twoNorm()
twoNorm in interface ConstantMatrixtwoNorm in class SparseVectorpublic double infinityNorm()
infinityNorm in interface ConstantMatrixinfinityNorm in class SparseVectorpublic void print()
print in interface ConstantMatrixprint in class SparseVectorprotected void sortIndices()
sortIndices in class SparseVectorprotected void removeDuplicates(int numDuplicates)
removeDuplicates in class SparseVector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||