darfix.decomposition.base.Base#

class darfix.decomposition.base.Base(data, num_components=None, indices=None, epsilon=1e-07)[source]#

Bases: object

Base class for decomposition package.

Parameters:
  • data – Numpy array or Hdf5 dataset with images in the rows and pixels in the columns.

  • num_components (Union[None,int], optional) – Number of components to keep, defaults to None

  • indices (Union[None,array_like], optional) – The indices of the values to use, defaults to None

  • epsilon (float) – Convergence tolerance, defaults to 1e-07

property data#
fit_transform(max_iter=100, error_step=None, compute_w=True, compute_h=True, norm='frobenius')[source]#

Fit to data, then transform it

Parameters:
  • max_iter (int, optional) – Maximum number of iterations, defaults to 100

  • error_step (Union[None,int], optional) – If None, error is not computed, defaults to None Else compute error for every error_step iterations.

  • compute_w (bool, optional) – When False, W is not computed, defaults to True

  • compute_h (bool, optional) – When False, H is not computed, defaults to True

frobenius_norm(chunks=200)[source]#

Frobenius norm (||data - WH||) of a data matrix and a low rank approximation given by WH. Minimizing the Fnorm is the most common optimization criterion for matrix factorization methods. Returns: ——- frobenius norm: F = ||data - WH||

property indices#
property num_components#
property num_features#
property num_samples#
squared_frobenius_norm(chunks=200)[source]#

Frobenius norm (||data - WH||) of a data matrix and a low rank approximation given by WH. Minimizing the Fnorm is the most common optimization criterion for matrix factorization methods. Returns: ——- frobenius norm: F = ||data - WH||