SymRidgeRegression

scalation.modeling.SymRidgeRegression

The SymRidgeRegression object supports symbolic ridge regression that allows variables/columns to be raised to various powers, e.g., x^2, x^3, x^.5. Note, x~^p is a column-wise power function (each column raised to p-th power). IMPORTANT: must not include INTERCEPT (column of ones) in initial data matrix), i.e., DO NOT include a column of ones in x (will cause singularity in expanded matrix). Method signatures are the as same as for SymbolicRegression, except there is NO intercept ARGUMENT.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(x: MatrixD, y: VectorD, fname: Array[String], powers: Set[Double], cross: Boolean, cross3: Boolean, hparam: HyperParameter, terms: Array[Xj2p]*): RidgeRegression

Create a RidgeRegression object from a data matrix and a response vector. Partial support for "Symbolic Ridge Regression" as matrix x can be raised to several powers (e.g., x^1 and x^2). Note, x^1 is automatically included. NOTE, Ridge Regression will NOT have an INTERCEPT column.

Create a RidgeRegression object from a data matrix and a response vector. Partial support for "Symbolic Ridge Regression" as matrix x can be raised to several powers (e.g., x^1 and x^2). Note, x^1 is automatically included. NOTE, Ridge Regression will NOT have an INTERCEPT column.

Value parameters

cross

whether to include 2-way cross/interaction terms x_i x_j (defaults to true)

cross3

whether to include 3-way cross/interaction terms x_i x_j x_k (defaults to false)

fname

the feature/variable names (defaults to null)

hparam

the hyper-parameters (defaults to RidgeRegression.hp)

powers

the set of powers to raise matrix x to (defaults to null)

terms

custom terms to add into the model, e.g., Array ((0, 1.0), (1, -2.0)) adds x0 x1^(-2)

x

the initial data/input m-by-n matrix (before expansion) must not include an intercept column of all ones

y

the response/output m-vector

Attributes

See also

SymbolicRegression.buildMatrix

def cubic(x: MatrixD, y: VectorD, fname: Array[String], cross: Boolean, cross3: Boolean, hparam: HyperParameter): RidgeRegression

Create a RidgeRegression object that uses multiple regression to fit a cubic surface to the data. For example in 2D, the cubic regression equation is y = b dot x + e = [b_0, ... b_k] dot [x_0, x_0^2, x_0^3, x_1, x_1^2, x_1^3, x_0x_1, x_0^2x_1, x_0*x_1^2] + e NOTE, Ridge Regression will NOT have an INTERCEPT column.

Create a RidgeRegression object that uses multiple regression to fit a cubic surface to the data. For example in 2D, the cubic regression equation is y = b dot x + e = [b_0, ... b_k] dot [x_0, x_0^2, x_0^3, x_1, x_1^2, x_1^3, x_0x_1, x_0^2x_1, x_0*x_1^2] + e NOTE, Ridge Regression will NOT have an INTERCEPT column.

Value parameters

cross

whether to include 2-way cross/interaction terms x_i x_j (defaults to false)

cross3

whether to include 3-way cross/interaction terms x_i x_j x_k (defaults to false)

fname

the feature/variable names (defaults to null)

hparam

the hyper-parameters (defaults to RidgeRegression.hp)

x

the initial data/input m-by-n matrix (before quadratic term expansion) must not include an intercept column of all ones

y

the response/output m-vector

Attributes

def quadratic(x: MatrixD, y: VectorD, fname: Array[String], cross: Boolean, hparam: HyperParameter): RidgeRegression

Create a RidgeRegression object that uses multiple regression to fit a quadratic surface to the data. For example in 2D, the quadratic regression equation is y = b dot x + e = [b_0, ... b_k] dot [x_0, x_0^2, x_1, x_1^2] + e NOTE, Ridge Regression will NOT have an INTERCEPT column.

Create a RidgeRegression object that uses multiple regression to fit a quadratic surface to the data. For example in 2D, the quadratic regression equation is y = b dot x + e = [b_0, ... b_k] dot [x_0, x_0^2, x_1, x_1^2] + e NOTE, Ridge Regression will NOT have an INTERCEPT column.

Value parameters

cross

whether to include cross terms x_i * x_j (defaults to false)

fname

the feature/variable names (defaults to null)

hparam

the hyper-parameters (defaults to RidgeRegression.hp)

x

the initial data/input m-by-n matrix (before quadratic term expansion) must not include an intercept column of all ones

y

the response/output m-vector

Attributes

def rescale(x: MatrixD, y: VectorD, fname: Array[String], powers: Set[Double], cross: Boolean, cross3: Boolean, hparam: HyperParameter, terms: Array[Xj2p]*): RidgeRegression

Create a SymRidgeRegression object from a data matrix and a response vector. This method provides data rescaling. NOTE, Ridge Regression will NOT have an INTERCEPT column.

Create a SymRidgeRegression object from a data matrix and a response vector. This method provides data rescaling. NOTE, Ridge Regression will NOT have an INTERCEPT column.

Value parameters

cross

whether to include 2-way cross/interaction terms x_i x_j (defaults to true)

cross3

whether to include 3-way cross/interaction terms x_i x_j x_k (defaults to false)

fname

the feature/variable names (defaults to null)

hparam

the hyper-parameters (defaults to Regression.hp)

powers

the set of powers to raise matrix x to (defualts to null)

terms

custom terms to add into the model, e.g., Array ((0, 1.0), (1, -2.0)) adds x0 x1^(-2)

x

the data/input m-by-n matrix (augment with a first column of ones to include intercept in model)

y

the response/output m-vector

Attributes