Smf (models.smf)

class nimfa.models.smf.Smf(params)

Bases: object

This class defines a common interface / model to handle standard MF models in a generic way.

It contains definitions of the minimum set of generic methods that are used in common computations and matrix factorizations. Besides it contains some quality and performance measures about factorizations.

basis()

Return the matrix of basis vectors (factor 1 matrix).

coef(idx=None)

Return the matrix of mixture coefficients (factor 2 matrix).

Parameters:idx (None) – Used in the multiple MF model. In standard MF idx is always None.
distance(metric='euclidean', idx=None)

Return the loss function value.

Parameters:
  • distance (str with values ‘euclidean’ or ‘kl’) – Specify distance metric to be used. Possible are Euclidean and Kullback-Leibler (KL) divergence. Strictly, KL is not a metric.
  • idx (None) – Used in the multiple MF model. In standard MF idx is always None.
fitted(idx=None)

Compute the estimated target matrix according to the MF algorithm model.

Parameters:idx (None) – Used in the multiple MF model. In standard MF idx is always None.
residuals(idx=None)

Return residuals matrix between the target matrix and its MF estimate.

Parameters:idx (None) – Used in the multiple MF model. In standard MF idx is always None.
target(idx=None)

Return the target matrix to estimate.

Parameters:idx (None) – Used in the multiple MF model. In standard MF idx is always None.
Fork me on GitHub