object TranRegression extends ModelFactory
The TranRegression
companion object provides transformation and inverse
transformation function based on the parameter 'lambda'.
It support the family of Box-Cox transformations.
Note, 'rescale' is defined in ModelFactory
in Model.scala.
- Alphabetic
- By Inheritance
- TranRegression
- ModelFactory
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
allForms(x: MatriD): MatriD
Create all forms/terms for each row/point placing them in a new matrix.
Create all forms/terms for each row/point placing them in a new matrix.
- x
the original un-expanded input/data matrix
- Definition Classes
- ModelFactory
-
def
apply(x: MatriD, y: VectoD, fname: Strings, hparam: HyperParameter, tran: FunctionS2S, itran: FunctionS2S, technique: RegTechnique.RegTechnique, bounds: PairD): TranRegression
Create a
TranRegression
with automatic rescaling from a data matrix and response vector.Create a
TranRegression
with automatic rescaling from a data matrix and response vector.- x
the data/input matrix
- y
the response/output vector
- fname
the feature/variable names
- hparam
the hyper-parameters (currently none)
- tran
the transformation function (defaults to log)
- itran
the inverse transformation function to rescale predictions to original y scale (defaults to exp)
- technique
the technique used to solve for b in x.t*x*b = x.t*y
- bounds
the bounds for rescaling
-
def
apply(xy: MatriD, fname: Strings, hparam: HyperParameter, tran: FunctionS2S, itran: FunctionS2S, technique: RegTechnique.RegTechnique, bounds: PairD): TranRegression
Create a
TranRegression
with automatic rescaling from a combined data matrix.Create a
TranRegression
with automatic rescaling from a combined data matrix.- xy
the combined data/input and response/output matrix
- fname
the feature/variable names
- hparam
the hyper-parameters (currently none)
- tran
the transformation function (defaults to log)
- itran
the inverse transformation function to rescale predictions to original y scale (defaults to exp)
- technique
the technique used to solve for b in x.t*x*b = x.t*y
- bounds
the bounds for rescaling
-
def
apply(x: MatriD, y: VectoD, fname: Strings = null, hparam: HyperParameter = null, technique: RegTechnique.RegTechnique = QR): TranRegression
Create a
TranRegression
object that uses a Box-Cox transformation.Create a
TranRegression
object that uses a Box-Cox transformation. To change 'lambda' from its default value, call 'set_lambda' first.- x
the data/input matrix
- y
the response/output vector
- fname
the feature/variable names
- hparam
the hyper-parameters (currently none)
- technique
the technique used to solve for b in x.t*x*b = x.t*y
-
def
box_cox(y: Double): Double
Transform 'y' using the Box-Cox transformation.
Transform 'y' using the Box-Cox transformation.
- y
the value to be transformed
-
def
cox_box(z: Double): Double
Inverse transform 'z' using the Box-Cox transformation.
Inverse transform 'z' using the Box-Cox transformation.
- z
the value to be inverse transformed
- val drp: (Null, Null, (Double) ⇒ Double, (Double) ⇒ Double, RegTechnique.Value, Null)
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
def
forms(xi: VectoD, k: Int, nt: Int): VectoD
Given a vector/point 'v', compute the values for all of its forms/terms, returning them as a vector (assumes
Regression
with intercept).Given a vector/point 'v', compute the values for all of its forms/terms, returning them as a vector (assumes
Regression
with intercept). Override for expanded columns, e.g.,QuadRegression
.- xi
the vector/point (i-th row of x) for creating forms/terms
- k
the number of features/predictor variables (not counting intercept)
- nt
the number of terms
- Definition Classes
- ModelFactory
-
def
numTerms(k: Int): Int
The number of terms/parameters in the model (assumes
Regression
with intercept.The number of terms/parameters in the model (assumes
Regression
with intercept. Override for expanded columns, e.g.,QuadRegression
.- k
the number of features/predictor variables (not counting intercept)
- Definition Classes
- ModelFactory
-
def
rescaleOff(): Unit
Turn rescaling off.
Turn rescaling off.
- Definition Classes
- ModelFactory
-
def
rescaleOn(): Unit
Turn rescaling on.
Turn rescaling on.
- Definition Classes
- ModelFactory
-
def
setLambda(lambda_: Double): Unit
Set the value for the 'lambda' parameter.
Set the value for the 'lambda' parameter. Must be called before Box-Cox 'apply' method.
- lambda_
the new value for the 'lambda' parameter