Package cc.mallet.util
Class VectorStats
- java.lang.Object
-
- cc.mallet.util.VectorStats
-
public class VectorStats extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description VectorStats()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SparseVector
mean(InstanceList instances)
Returns aSparseVector
whose entries (taken from the union of those in the instances) are the expected values of those in theInstanceList
.static SparseVector
mean(InstanceList instances, int numIndices)
Returns aSparseVector
whose entries (dense with the given number of indices) are the expected values of those in theInstanceList
.static SparseVector
mean(InstanceList instances, int[] indices)
Returns aSparseVector
whose entries (the given indices) are the expected values of those in theInstanceList
.static SparseVector
stddev(InstanceList instances)
Square root of unbiased variance.static SparseVector
stddev(InstanceList instances, boolean unbiased)
Square root of variance.static SparseVector
stddev(InstanceList instances, SparseVector mean)
Square root of unbiased variance of instances having the given meanstatic SparseVector
stddev(InstanceList instances, SparseVector mean, boolean unbiased)
Square root of variance.static SparseVector
variance(InstanceList instances)
Returns unbiased variancestatic SparseVector
variance(InstanceList instances, boolean unbiased)
Returns aSparseVector
whose entries (taken from the union of those in the instances) are the variance of those in theInstanceList
.static SparseVector
variance(InstanceList instances, SparseVector mean)
Returns unbiased variance of instances having the given mean.static SparseVector
variance(InstanceList instances, SparseVector mean, boolean unbiased)
Returns aSparseVector
whose entries (taken from the mean argument) are the variance of those in theInstanceList
.
-
-
-
Method Detail
-
mean
public static SparseVector mean(InstanceList instances)
Returns aSparseVector
whose entries (taken from the union of those in the instances) are the expected values of those in theInstanceList
. This implies the returned vector will not have binary values.
-
mean
public static SparseVector mean(InstanceList instances, int numIndices)
Returns aSparseVector
whose entries (dense with the given number of indices) are the expected values of those in theInstanceList
. This implies the returned vector will not have binary values.
-
mean
public static SparseVector mean(InstanceList instances, int[] indices)
Returns aSparseVector
whose entries (the given indices) are the expected values of those in theInstanceList
. This implies the returned vector will not have binary values.
-
variance
public static SparseVector variance(InstanceList instances, boolean unbiased)
Returns aSparseVector
whose entries (taken from the union of those in the instances) are the variance of those in theInstanceList
. This implies the returned vector will not have binary values.- Parameters:
unbiased
- Normalizes by N-1 when true, and by N otherwise.
-
variance
public static SparseVector variance(InstanceList instances, SparseVector mean, boolean unbiased)
Returns aSparseVector
whose entries (taken from the mean argument) are the variance of those in theInstanceList
. This implies the returned vector will not have binary values.- Parameters:
unbiased
- Normalizes by N-1 when true, and by N otherwise.
-
variance
public static SparseVector variance(InstanceList instances)
Returns unbiased variance
-
variance
public static SparseVector variance(InstanceList instances, SparseVector mean)
Returns unbiased variance of instances having the given mean.
-
stddev
public static SparseVector stddev(InstanceList instances, SparseVector mean, boolean unbiased)
Square root of variance.- Parameters:
mean
- Mean of the given instances.unbiased
- Normalizes variance by N-1 when true, and by N otherwise.- See Also:
variance(cc.mallet.types.InstanceList,boolean)
-
stddev
public static SparseVector stddev(InstanceList instances)
Square root of unbiased variance.
-
stddev
public static SparseVector stddev(InstanceList instances, boolean unbiased)
Square root of variance.- Parameters:
unbiased
- Normalizes variance by N-1 when true, and by N otherwise.- See Also:
variance(cc.mallet.types.InstanceList,boolean)
-
stddev
public static SparseVector stddev(InstanceList instances, SparseVector mean)
Square root of unbiased variance of instances having the given mean
-
-