All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.m5.Matrix

java.lang.Object
   |
   +----weka.classifiers.m5.Matrix

public final class Matrix
extends Object
Class for handling a matrix

Version:
$Revision: 1.2 $
Author:
Yong Wang (yongwang@cs.waikato.ac.nz)

Constructor Index

 o Matrix(int, int)
Constructs a matrix

Method Index

 o lubksb(int, int[], double[])
LU backward substitution
 o ludcmp(int, int[])
LU decomposition
 o multiply(Matrix, int, int, int)
Reurns the multiplication of two matrices
 o regression(Matrix, int, int)
Linear regression
 o toString(int, int, int, int)
Converts a matrix to a string
 o transpose(int, int)
Returns the transpose of a matrix [0:n-1][0:m-1]

Constructors

 o Matrix
 public Matrix(int nr,
               int nc)
Constructs a matrix

Parameters:
nr - the number of the rows
nc - the number of the columns

Methods

 o toString
 public final String toString(int nrl,
                              int nrh,
                              int ncl,
                              int nch)
Converts a matrix to a string

Parameters:
nrl - the smallest index of the rows
nrh - the largest index of the rows
ncl - the smallest index of the column
ncl - the largest index of the column
Returns:
the converted string
 o transpose
 public final Matrix transpose(int n,
                               int m)
Returns the transpose of a matrix [0:n-1][0:m-1]

Parameters:
n - the number of rows
m - the number of columns
Returns:
the transposed matrix
 o multiply
 public final Matrix multiply(Matrix b,
                              int l,
                              int m,
                              int n)
Reurns the multiplication of two matrices

Parameters:
b - the multiplication matrix
l - the number of the rows of the instance matrix
m - the number of the columns of the instance matrix, and the number of the rows of matrix b
n - the number of the columns of matrix b
Returns:
the product matrix
 o regression
 public final double[] regression(Matrix y,
                                  int n,
                                  int m)
Linear regression

Parameters:
y - the dependent variable vector
n - the number of the observations
m - the number of the coefficients
Returns:
the coefficients
 o lubksb
 public final void lubksb(int n,
                          int indx[],
                          double b[])
LU backward substitution

Parameters:
n - the number of the coefficients
indx - the index
b - the double vector, storing constant terms in the equation sets; it later stores the computed coefficients' values
 o ludcmp
 public final int[] ludcmp(int n,
                           int indx[])
LU decomposition

Parameters:
n - the number of coefficients
indx - the index
Returns:
the integer vector of the attributes's singularities

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home