trait ModelFactory extends Error
The ModelFactory
trait is intended for use in Model
factory objects.
It supports expansion of the data matrix and rescaling of data values.
When the 'rescale' flag is on/true, the companion object factory 'apply'
functions should rescale or normalize the data appropriately to the particular
modeling technique (or even to the level of the activation function used).
In ScalaTion, model constructors do not rescale, but 'apply' functions
that call model constructors need to provide this option.
For example,
val model1 = new Regression (x, y, fname, hparam, technique) val model2 = Regression (x, y, fname, hparam, technique)
'model1' will not have its data rescaled, while 'model2' will.
- Alphabetic
- By Inheritance
- 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
-
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
-
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)
-
def
rescaleOff(): Unit
Turn rescaling off.
-
def
rescaleOn(): Unit
Turn rescaling on.