trait Predictor extends Model
The Predictor
trait provides a common framework for several types of predictors.
y = f(x; b) + e
y = response/output value x = predictor/input vector b = parameter vector e = residual/error value
A predictor is for potentially unbounded responses (real or integer).
When the number of distinct responses is bounded by some relatively small
integer 'k', a classifier is likely more appropriate.
Note, the 'train' method (from Model
) must be called first followed by 'eval'.
- Alphabetic
- By Inheritance
- Predictor
- Model
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
analyze(x_: MatriD, y_: VectoD, x_e: MatriD, y_e: VectoD): Predictor
Analyze a dataset using this model using ordinary training with the 'train' method.
Analyze a dataset using this model using ordinary training with the 'train' method.
- x_
the training/full data/input matrix (impl. classes should default x_ to x)
- y_
the training/full response/output vector (impl. classes should default y_ to y)
- x_e
the test/full data/input matrix (impl. classes should default x_e to x)
- y_e
the test/full response/output vector (impl. classes should default y_e to y)
-
abstract
def
eval(x_e: MatriD, y_e: VectoD): Model
Evaluate the model's Quality of Fit (QoF) as well as the importance of its parameters (e.g., if 0 is in a parameter's confidence interval, it is a candidate for removal from the model).
Evaluate the model's Quality of Fit (QoF) as well as the importance of its parameters (e.g., if 0 is in a parameter's confidence interval, it is a candidate for removal from the model). Extending traits and classess should implement various diagnostics for the test and full (training + test) datasets.
- x_e
the test/full data/input matrix (impl. classes should default to x)
- y_e
the test/full response/output vector (impl. classes should default to y)
- Definition Classes
- Model
-
abstract
def
forwardSel(cols: Set[Int], index_q: Int): (Int, Predictor)
Perform forward selection to add the most predictive variable to the existing model, returning the variable to add and the new model.
Perform forward selection to add the most predictive variable to the existing model, returning the variable to add and the new model. May be called repeatedly.
- cols
the columns of matrix x included in the existing model
- index_q
index of Quality of Fit (QoF) to use for comparing quality
- See also
Fit
for index of QoF measures.
-
abstract
def
getX: MatriD
Return the 'used' data matrix 'x'.
Return the 'used' data matrix 'x'. Mainly for derived classes where 'x' is expanded from the given columns in 'x_', e.g.,
QuadRegression
add squared columns. -
abstract
def
getY: VectoD
Return the 'used' response vector 'y'.
Return the 'used' response vector 'y'. Mainly for derived classes where 'y' is transformed, e.g.,
TranRegression
,Regression4TS
. -
abstract
def
hparameter: HyperParameter
Return the model hyper-parameters (if none, return null).
Return the model hyper-parameters (if none, return null). Hyper-parameters may be used to regularize parameters or tune the optimizer.
- Definition Classes
- Model
-
abstract
def
parameter: VectoD
Return the vector of model parameter/coefficient values.
Return the vector of model parameter/coefficient values.
- Definition Classes
- Model
-
abstract
def
predict(z: MatriD): VectoD
Predict the value of 'y = f(z)' by evaluating the formula 'y = b dot z', for each row of matrix 'z'.
Predict the value of 'y = f(z)' by evaluating the formula 'y = b dot z', for each row of matrix 'z'.
- z
the new matrix to predict (impl. classes should default z to x)
-
abstract
def
predict(z: VectoD): Double
Given a new continuous data/input vector 'z', predict the 'y'-value of 'f(z)'.
Given a new continuous data/input vector 'z', predict the 'y'-value of 'f(z)'.
- z
the vector to use for prediction
-
abstract
def
report: String
Return a basic report on the trained model.
Return a basic report on the trained model.
- Definition Classes
- Model
- See also
'summary' method for more details
-
abstract
def
residual: VectoD
Return the vector of residuals/errors.
-
abstract
def
train(x_: MatriD, y_: VectoD): Model
Train the model 'y_ = f(x_) + e' on a given dataset, by optimizing the model parameters in order to minimize error '||e||' or maximize log-likelihood 'll'.
Train the model 'y_ = f(x_) + e' on a given dataset, by optimizing the model parameters in order to minimize error '||e||' or maximize log-likelihood 'll'.
- x_
the training/full data/input matrix (impl. classes should default to x)
- y_
the training/full response/output vector (impl. classes should default to y)
- Definition Classes
- Model
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
corrMatrix(xx: MatriD): MatriD
Return the correlation matrix for the columns in data matrix 'xx'.
Return the correlation matrix for the columns in data matrix 'xx'.
- xx
the data matrix shose correlation matrix is sought
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
modelConcept: URI
An optional reference to an ontological concept
An optional reference to an ontological concept
- Definition Classes
- Model
-
def
modelName: String
An optional name for the model (or modeling technique)
An optional name for the model (or modeling technique)
- Definition Classes
- Model
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
predict(z: VectoI): Double
Given a new discrete data/input vector 'z', predict the 'y'-value of 'f(z)'.
Given a new discrete data/input vector 'z', predict the 'y'-value of 'f(z)'.
- z
the vector to use for prediction
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
test(modelName: String, doPlot: Boolean = true): Unit
Test the model on the full dataset (i.e., train and evaluate on full dataset).
Test the model on the full dataset (i.e., train and evaluate on full dataset).
- modelName
the name of the model being tested
- doPlot
whether to plot the actual vs. predicted response
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated