C# Class MyMediaLite.DataType.MatrixUtils

Utilities to work with matrices
Afficher le fichier Open project: zenogantner/MML-KDD

Méthodes publiques

Méthode Description
ColumnAverage ( Matrix matrix, int col ) : double

Compute the average value of the entries in a column of a matrix

ColumnInitNormal ( Matrix matrix, double mean, double stdev, int column ) : void

Initializes one column of a double matrix with normal distributed (Gaussian) noise

FrobeniusNorm ( Matrix matrix ) : double

Compute the Frobenius norm (square root of the sum of squared entries) of a matrix

See http://en.wikipedia.org/wiki/Matrix_norm

Inc ( Matrix matrix1, Matrix matrix2 ) : void

Increment the elements in one matrix by the ones in another

Inc ( Matrix matrix, int i, int j, double v ) : void

Increments the specified matrix element by a double value

InitNormal ( Matrix matrix, double mean, double stdev ) : void

Initializes a double matrix with normal distributed (Gaussian) noise

Multiply ( Matrix matrix, double d ) : void

Multiply all entries of a matrix with a scalar

RowAverage ( Matrix matrix, int row ) : double

Compute the average value of the entries in a row of a matrix

RowDifference ( Matrix matrix1, int i, Matrix matrix2, int j ) : IList

Compute the difference vector between two rows of two matrices

RowInitNormal ( Matrix matrix, double mean, double stdev, int row ) : void

Initializes one row of a double matrix with normal distributed (Gaussian) noise

RowScalarProduct ( Matrix matrix, int i, IList vector ) : double

Compute the scalar product between a vector and a row of the matrix

RowScalarProduct ( Matrix matrix1, int i, Matrix matrix2, int j ) : double

Compute the scalar product between two rows of two matrices

RowScalarProductWithRowDifference ( Matrix matrix1, int i, Matrix matrix2, int j, Matrix matrix3, int k ) : double

Compute the scalar product of a matrix row with the difference vector of two other matrix rows

Method Details

ColumnAverage() public static méthode

Compute the average value of the entries in a column of a matrix
public static ColumnAverage ( Matrix matrix, int col ) : double
matrix Matrix the matrix
col int the column ID
Résultat double

ColumnInitNormal() public static méthode

Initializes one column of a double matrix with normal distributed (Gaussian) noise
public static ColumnInitNormal ( Matrix matrix, double mean, double stdev, int column ) : void
matrix Matrix the matrix to initialize
mean double the mean of the normal distribution drawn from
stdev double the standard deviation of the normal distribution
column int the column to be initialized
Résultat void

FrobeniusNorm() public static méthode

Compute the Frobenius norm (square root of the sum of squared entries) of a matrix
See http://en.wikipedia.org/wiki/Matrix_norm
public static FrobeniusNorm ( Matrix matrix ) : double
matrix Matrix the matrix
Résultat double

Inc() public static méthode

Increment the elements in one matrix by the ones in another
public static Inc ( Matrix matrix1, Matrix matrix2 ) : void
matrix1 Matrix the matrix to be incremented
matrix2 Matrix the other matrix
Résultat void

Inc() public static méthode

Increments the specified matrix element by a double value
public static Inc ( Matrix matrix, int i, int j, double v ) : void
matrix Matrix The matrix.
i int the row
j int the column
v double the value
Résultat void

InitNormal() public static méthode

Initializes a double matrix with normal distributed (Gaussian) noise
public static InitNormal ( Matrix matrix, double mean, double stdev ) : void
matrix Matrix the matrix to initialize
mean double the mean of the normal distribution drawn from
stdev double the standard deviation of the normal distribution
Résultat void

Multiply() public static méthode

Multiply all entries of a matrix with a scalar
public static Multiply ( Matrix matrix, double d ) : void
matrix Matrix the matrix
d double the number to multiply with
Résultat void

RowAverage() public static méthode

Compute the average value of the entries in a row of a matrix
public static RowAverage ( Matrix matrix, int row ) : double
matrix Matrix the matrix
row int the row ID
Résultat double

RowDifference() public static méthode

Compute the difference vector between two rows of two matrices
public static RowDifference ( Matrix matrix1, int i, Matrix matrix2, int j ) : IList
matrix1 Matrix the first matrix
i int the first row ID
matrix2 Matrix the second matrix
j int the second row ID
Résultat IList

RowInitNormal() public static méthode

Initializes one row of a double matrix with normal distributed (Gaussian) noise
public static RowInitNormal ( Matrix matrix, double mean, double stdev, int row ) : void
matrix Matrix the matrix to initialize
mean double the mean of the normal distribution drawn from
stdev double the standard deviation of the normal distribution
row int the row to be initialized
Résultat void

RowScalarProduct() public static méthode

Compute the scalar product between a vector and a row of the matrix
public static RowScalarProduct ( Matrix matrix, int i, IList vector ) : double
matrix Matrix the matrix
i int the row ID
vector IList the numeric vector
Résultat double

RowScalarProduct() public static méthode

Compute the scalar product between two rows of two matrices
public static RowScalarProduct ( Matrix matrix1, int i, Matrix matrix2, int j ) : double
matrix1 Matrix the first matrix
i int the first row ID
matrix2 Matrix the second matrix
j int the second row ID
Résultat double

RowScalarProductWithRowDifference() public static méthode

Compute the scalar product of a matrix row with the difference vector of two other matrix rows
public static RowScalarProductWithRowDifference ( Matrix matrix1, int i, Matrix matrix2, int j, Matrix matrix3, int k ) : double
matrix1 Matrix the first matrix
i int the first row ID
matrix2 Matrix the second matrix
j int the second row ID
matrix3 Matrix the third matrix
k int the third row ID
Résultat double