object KNN_Predictor extends ModelFactory
The KNN_Predictor
companion object provides a factory functions.
- Alphabetic
- By Inheritance
- KNN_Predictor
- ModelFactory
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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): KNN_Predictor
Create a
KNN_Predictor
object from a data matrix and a response vector.Create a
KNN_Predictor
object from a data matrix and a response vector. This factory function provides data rescaling.- 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
- fname
the feature/variable names (use null for default)
- hparam
the hyper-parameters (use null for default)
- See also
ModelFactory
- def apply(xy: MatriD, fname: Strings = null, hparam: HyperParameter = hp): KNN_Predictor
Create a
KNN_Predictor
object from a combined 'xy' data-response matrix.Create a
KNN_Predictor
object from a combined 'xy' data-response matrix.- xy
the combined data-response matrix
- fname
the names for all features/variables
- hparam
the number of nearest neighbors to consider
- val drp: (Null, HyperParameter)
- 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
- val hp: HyperParameter
- 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