程序包 weka.core
类 Matrix
java.lang.Object
weka.core.Matrix
- 所有已实现的接口:
Serializable
,Cloneable
,RevisionHandler
- 直接已知子类:
ConfusionMatrix
已过时。
Class for performing operations on a matrix of floating-point values.
Deprecated: Uses internally the code of the sub-package
weka.core.matrix
- only for backwards compatibility.- 版本:
- $Revision: 1.25 $
- 作者:
- Gabi Schmidberger (gabi@cs.waikato.ac.nz), Yong Wang (yongwang@cs.waikato.ac.nz), Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (eibe@cs.waikato.ac.nz), Fracpete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final Matrix
已过时。Returns the sum of this matrix with another.final void
addElement
(int rowIndex, int columnIndex, double value) 已过时。Add a value to an element.clone()
已过时。Creates and returns a clone of this object.void
eigenvalueDecomposition
(double[][] V, double[] d) 已过时。Performs Eigenvalue Decomposition using Householder QR Factorization Matrix must be symmetrical.double[]
getColumn
(int index) 已过时。Gets a column of the matrix and returns it as a double array.final double
getElement
(int rowIndex, int columnIndex) 已过时。Returns the value of a cell in the matrix.getL()
已过时。Returns the L part of the matrix.已过时。Returns the revision string.double[]
getRow
(int index) 已过时。Gets a row of the matrix and returns it as double array.getU()
已过时。Returns the U part of the matrix.boolean
已过时。Returns true if the matrix is symmetric.int[]
已过时。Performs a LUDecomposition on the matrix.static void
已过时。Main method for testing this class.final Matrix
已过时。Returns the multiplication of two matricesfinal int
已过时。Returns the number of columns in the matrix.final int
numRows()
已过时。Returns the number of rows in the matrix.static Matrix
parseMatlab
(String matlab) 已过时。creates a matrix from the given Matlab string.final double[]
regression
(Matrix y, double ridge) 已过时。Performs a (ridged) linear regression.final double[]
regression
(Matrix y, double[] w, double ridge) 已过时。Performs a weighted (ridged) linear regression.final void
setColumn
(int index, double[] newColumn) 已过时。Sets a column of the matrix to the given column.final void
setElement
(int rowIndex, int columnIndex, double value) 已过时。Sets an element of the matrix to the given value.final void
setRow
(int index, double[] newRow) 已过时。Sets a row of the matrix to the given row.void
solve
(double[] bb) 已过时。Solve A*X = B using backward substitution.toMatlab()
已过时。converts the Matrix into a single line Matlab string: matrix is enclosed by parentheses, rows are separated by semicolon and single cells by blanks, e.g., [1 2; 3 4].toString()
已过时。Converts a matrix to a stringfinal Matrix
已过时。Returns the transpose of a matrix.void
已过时。Writes out a matrix.
-
构造器详细资料
-
Matrix
public Matrix(int nr, int nc) 已过时。Constructs a matrix and initializes it with default values.- 参数:
nr
- the number of rowsnc
- the number of columns
-
Matrix
已过时。Constructs a matrix using a given array.- 参数:
array
- the values of the matrix- 抛出:
Exception
-
Matrix
已过时。Reads a matrix from a reader. The first line in the file should contain the number of rows and columns. Subsequent lines contain elements of the matrix.- 参数:
r
- the reader containing the matrix- 抛出:
Exception
- if an error occurs
-
-
方法详细资料
-
clone
已过时。Creates and returns a clone of this object.- 返回:
- a clone of this instance.
- 抛出:
Exception
- if an error occurs
-
write
已过时。Writes out a matrix.- 参数:
w
- the output Writer- 抛出:
Exception
- if an error occurs
-
getElement
public final double getElement(int rowIndex, int columnIndex) 已过时。Returns the value of a cell in the matrix.- 参数:
rowIndex
- the row's indexcolumnIndex
- the column's index- 返回:
- the value of the cell of the matrix
-
addElement
public final void addElement(int rowIndex, int columnIndex, double value) 已过时。Add a value to an element.- 参数:
rowIndex
- the row's index.columnIndex
- the column's index.value
- the value to add.
-
numRows
public final int numRows()已过时。Returns the number of rows in the matrix.- 返回:
- the number of rows
-
numColumns
public final int numColumns()已过时。Returns the number of columns in the matrix.- 返回:
- the number of columns
-
setElement
public final void setElement(int rowIndex, int columnIndex, double value) 已过时。Sets an element of the matrix to the given value.- 参数:
rowIndex
- the row's indexcolumnIndex
- the column's indexvalue
- the value
-
setRow
public final void setRow(int index, double[] newRow) 已过时。Sets a row of the matrix to the given row. Performs a deep copy.- 参数:
index
- the row's indexnewRow
- an array of doubles
-
getRow
public double[] getRow(int index) 已过时。Gets a row of the matrix and returns it as double array.- 参数:
index
- the row's index- 返回:
- an array of doubles
-
getColumn
public double[] getColumn(int index) 已过时。Gets a column of the matrix and returns it as a double array.- 参数:
index
- the column's index- 返回:
- an array of doubles
-
setColumn
public final void setColumn(int index, double[] newColumn) 已过时。Sets a column of the matrix to the given column. Performs a deep copy.- 参数:
index
- the column's indexnewColumn
- an array of doubles
-
toString
已过时。Converts a matrix to a string -
add
已过时。Returns the sum of this matrix with another.- 返回:
- a matrix containing the sum.
-
transpose
已过时。Returns the transpose of a matrix.- 返回:
- the transposition of this instance.
-
isSymmetric
public boolean isSymmetric()已过时。Returns true if the matrix is symmetric.- 返回:
- boolean true if matrix is symmetric.
-
multiply
已过时。Returns the multiplication of two matrices- 参数:
b
- the multiplication matrix- 返回:
- the product matrix
-
regression
已过时。Performs a (ridged) linear regression.- 参数:
y
- the dependent variable vectorridge
- the ridge parameter- 返回:
- the coefficients
- 抛出:
IllegalArgumentException
- if not successful
-
regression
已过时。Performs a weighted (ridged) linear regression.- 参数:
y
- the dependent variable vectorw
- the array of data point weightsridge
- the ridge parameter- 返回:
- the coefficients
- 抛出:
IllegalArgumentException
- if the wrong number of weights were provided.
-
getL
已过时。Returns the L part of the matrix. This does only make sense after LU decomposition.- 返回:
- matrix with the L part of the matrix;
- 抛出:
Exception
- 另请参阅:
-
getU
已过时。Returns the U part of the matrix. This does only make sense after LU decomposition.- 返回:
- matrix with the U part of a matrix;
- 抛出:
Exception
- 另请参阅:
-
LUDecomposition
已过时。Performs a LUDecomposition on the matrix. It changes the matrix into its LU decomposition.- 返回:
- the indices of the row permutation
- 抛出:
Exception
-
solve
已过时。Solve A*X = B using backward substitution. A is current object (this). Note that this matrix will be changed! B parameter bb. X returned in parameter bb.- 参数:
bb
- first vector B in above equation then X in same equation.- 抛出:
Exception
-
eigenvalueDecomposition
已过时。Performs Eigenvalue Decomposition using Householder QR Factorization Matrix must be symmetrical. Eigenvectors are return in parameter V, as columns of the 2D array. (Real parts of) Eigenvalues are returned in parameter d.- 参数:
V
- double array in which the eigenvectors are returnedd
- array in which the eigenvalues are returned- 抛出:
Exception
- if matrix is not symmetric
-
toMatlab
已过时。converts the Matrix into a single line Matlab string: matrix is enclosed by parentheses, rows are separated by semicolon and single cells by blanks, e.g., [1 2; 3 4].- 返回:
- the matrix in Matlab single line format
-
parseMatlab
已过时。creates a matrix from the given Matlab string.- 参数:
matlab
- the matrix in matlab format- 返回:
- the matrix represented by the given string
- 抛出:
Exception
- 另请参阅:
-
getRevision
已过时。Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
main
已过时。Main method for testing this class.
-
weka.core.matrix.Matrix
instead - only for backwards compatibility.