Created on Sep 17, 2012
@author: georgianadinu
Bases: composes.matrix.matrix.Matrix
classdocs
Checks of the values in two matrices are all_close.
Asserts that all values are larger or equal to 0.
Turns negative entries to 0.
Horizontal stack of two matrices.
Builds the identity matrix.
Checks if more than 50% of the non zero elements of a matrix are positive.
Computes component-wise multiplication of two matrices.
Class method, horizontal stack of n matrices.
Class method, vertical stack of n matrices.
Computes the norms on a certain axis or of the entire matrix.
Applies positive log to the matrix elements.
Elements smaller than 1 (leading to not-defined log or negative log) are set to 0. Log is applied on all other elements.
Modifies the current matrix.
Sets values smaller than an epsilon to 0.
Reshapes current matrix.
Overwrites the current matrix with a new matrix of the given shape!
Scales each column of the matrix by the values given in an array.
Scales each row of the matrix by the values given in an array.
Returns a copy is copy=True, returns self otherwise.
Turns negative entries to 0.
Modifies the current matrix: all negative entries are set to 0.
Turns strictly positive entries to 1 and negative entries to 0.
Converts to SparseMatrix.
Transposes the current matrix.
Created on Oct 4, 2012
@author: georgianadinu
Bases: object
Contains a set of liniar algebra utilities defined to work both with sparse and with dense matrices as an input (i.e. with objects of type SparseMatrix/DenseMatrix).
Performs Least Squares Regression.
Solves the problem:
\(X = argmin(||AX - B||_2)\)
Performs Non-negative Matrix Factorization.
It solves the problem: \(W,H = argmin(||X - WH||_2)\) such that W and H are non-negative matrices.
Computes the pseudo-inverse of a matrix.
Performs Ridge Regression.
Performs SVD decomposition.
If the rank is smaller than the requested reduced dimension, reduction to rank is performed. Dense SVD uses Linalg._SVD_TOL to decide the rank of the matrix.
Created on Sep 17, 2012
@author: georgianadinu
Bases: object
Provides a common interface for matrix implementations.
Provides a common interface for different matrix implementations (sparse/dense). In vector space models, a matrix is used to encode a set of entities such as words or phrases (rows) described in terms of contextual features (columns).
Asserts that the matrix has the same shape as a second matrix.
Stores the actual matrix structure of the Matrix object. Of type numpy.matrix for DenseMatrix, and scipy.sparse.csr_matrix for SparseMatrix.
Shape of the matrix, tuple with two elements.
Computes the permutation resulted when sorting the matrix on an axis, according to a function, in descending order.
Sorts the rows or the columns (as given by axis) of a matrix according to a norm_function and returns the permutation of this as a np.array
axis_: axis value, one of 0/1
Created on Sep 17, 2012
@author: georgianadinu
Bases: composes.matrix.matrix.Matrix
classdocs
Checks of the values in two matrices are all_close.
Asserts that all values are larger or equal to 0.
Turns negative entries to 0.
Horizontal stack of two matrices.
Builds the identity matrix.
Checks if more than 50% of the non zero elements of a matrix are positive.
Computes component-wise multiplication of two matrices.
Class method, horizontal stack of n matrices.
Class method, vertical stack of n matrices.
Computes the norms on a certain axis or of the entire matrix.
Applies positive log to the matrix elements.
Elements smaller than 1 (leading to not-defined log or negative log) are set to 0. Log is applied on all other elements.
Modifies the current matrix.
Sets values smaller than an epsilon to 0.
Reshapes current matrix.
Overwrites the current matrix with a new matrix of the given shape!
Scales each column of the matrix by the values given in an array.
Scales each row of the matrix by the values given in an array.
Converts to DenseMatrix.
Turns negative entries to 0.
Modifies the current matrix: all negative entries are set to 0.
Turns strictly positive entries to 1 and negative entries to 0.
Returns a copy is copy=True, returns self otherwise.
Transposes the current matrix.