public class LogEntropyTransform.LogEntropyGlobalTransform extends Object implements GlobalTransform
GlobalTransform| Constructor and Description |
|---|
LogEntropyTransform.LogEntropyGlobalTransform(File inputMatrixFile,
MatrixIO.Format format)
|
LogEntropyTransform.LogEntropyGlobalTransform(Matrix matrix)
Creates an instance of
LogEntropyGlobalTransform from a
Matrix. |
| Modifier and Type | Method and Description |
|---|---|
double |
transform(int row,
int column,
double value)
Calculates the entropy (information gain) where
value is the
number of occurances of item row with feature column. |
public LogEntropyTransform.LogEntropyGlobalTransform(Matrix matrix)
LogEntropyGlobalTransform from a
Matrix.public LogEntropyTransform.LogEntropyGlobalTransform(File inputMatrixFile, MatrixIO.Format format)
public double transform(int row,
int column,
double value)
value is the
number of occurances of item row with feature column.
The item entropy is defined as:
1 + entropy(item) / log(numberOfFeatures)
with entropy defined as:
sum_features(p(item, feature) * log(p(item, feature)))transform in interface GlobalTransformrow - The index specifying the observed itemcolumn - The index specifying the observed featurevalue - The number occurances of the item and the featureCopyright © 2012. All Rights Reserved.