Table Of Contents

This Page

scaling Package

epmi_weighting Module

class composes.transformation.scaling.epmi_weighting.EpmiWeighting

Bases: composes.transformation.scaling.scaling.Scaling

Exponential Point-wise Mutual Information.

\(epmi(r,c) = \frac{P(r,c)}{P(r)P(c)}\)

apply(matrix_, column_marginal=None)

Performs epmi weighting.

Args:

matrix_ (Matrix): Input matrix

column_marginal (np.ndarray): column marginals of the
core matrix if the matrix is a peripheral matrix
Returns:
Matrix: the matrix after applying epmi.
get_column_stats(matrix_)

normalization Module

Created on Oct 4, 2012

@author: georgianadinu

class composes.transformation.scaling.normalization.Normalization(**kwargs)

Bases: composes.transformation.scaling.scaling.Scaling

Normalizes the a space according to a some criterion.

Available criteria:

sum: Default. The result matrix \(X\) will satisfy: \(\sum_{i,j} X_{ij}=1\)

length: The result matrix \(X\) will satisfy: \(\sqrt{\sum_{i,j} X_{ij}^2}=1\)

apply(matrix_, total=None)
criterion = 'sum'
get_column_stats(matrix_)

plmi_weighting Module

class composes.transformation.scaling.plmi_weighting.PlmiWeighting

Bases: composes.transformation.scaling.scaling.Scaling

Positive Local Mutual Information.

\(plmi(r,c)=ppmi(r,c)count(r,c)\)

apply(matrix_, column_marginal=None)
get_column_stats(matrix_)

plog_weighting Module

class composes.transformation.scaling.plog_weighting.PlogWeighting

Bases: composes.transformation.scaling.scaling.Scaling

Positive Log Weighting

\(plog(r,c)= log(r,c) \text{ if } log(r,c) \geq 0 \text{ else } 0\)

apply(matrix_)

Performs positive log weighting.

Args:
matrix_ (Matrix): Input matrix column_marginal (array): column marginals of the core matrix if the matrix is a peripheral matrix
Returns:
Matrix: the matrix after applying plog

ppmi_weighting Module

class composes.transformation.scaling.ppmi_weighting.PpmiWeighting

Bases: composes.transformation.scaling.scaling.Scaling

Positive Point-wise Mutual Information.

\(pmi(r,c) = log\frac{P(r,c)}{P(r)P(c)}\)

\(ppmi(r,c)= pmi(r,c) \text{ if } pmi(r,c)\geq 0 \text{ else } 0\)

apply(matrix_, column_marginal=None)
get_column_stats(matrix_)

row_normalization Module

Created on Oct 4, 2012

@author: georgianadinu

class composes.transformation.scaling.row_normalization.RowNormalization(**kwargs)

Bases: composes.transformation.scaling.scaling.Scaling

Normalizes the rows of a space according to a some criterion.

Available criteria:

length: Default. Each row \(X_i\) of the result matrix will satisfy: \(\sqrt{\sum_j X_{ij}^2}=1\)

sum: Each row \(X_i\) of the result matrix will satisfy: \(\sum_j X_{ij}=1\)

apply(matrix_)
criterion = 'length'

scaling Module

Created on Sep 20, 2012

@author: georgianadinu

class composes.transformation.scaling.scaling.Scaling

Bases: object

classdocs

create_operation()
get_name()
get_uses_column_stats()
name
uses_column_stats