FitM

scalation.modeling.FitM
See theFitM companion object
trait FitM

The FitM trait provides methods to determine basic Quality of Fit 'QoF' metrics/measures suitable for all Models. Note, to work with multiple types of models where degrees of freedom (df) may be hard to calculate, sde uses m-1 rather than df for sample estimates, while rmse uses a population formula (i.e., divide by m). Therefore, in ScalaTion sde will be slightly larger than rmse.

Attributes

See also

Fit for a more complete implementation suitable for several models.

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait FitC
class BaggingTrees
class RandomForest
class HiddenMarkov
class NaiveBayes
class NaiveBayesR
class NullModel
class SimpleLDA
class TANBayes
class RNN
class Baseline
trait Fit
class Diagnoser
class AR_Star
class VAR
class Forecaster
class AR
class ARMA
class ARIMA
class Forecaster_D
class ARX_D
class ARX_Quad_D
class ARX_Symb_D
class ARY_D
class ARX
class ARX_Quad
class ARX_Symb
class ARY
class ARY_Quad
class SARY
class NullModel
class RandomWalk
class RandomWalkS
class TranARY
class TrendModel
class AR
class AR1MA
class ARIMA
class ARMA
class NullModel
class QuadSpline
class RandomWalk
class TrendModel
class CNN_1D
class CNN_2D
class ELM_3L1
class NeuralNet_2L
class NeuralNet_3L
class NeuralNet_XL
class RegressionMV
class NullModel
class Perceptron
class Regression
class ARX
class ARX_Quad
class TestFit
Show all

Members list

Value members

Concrete methods

def diagnose(y: VectorD, yp: VectorD, w: VectorD): VectorD

Diagnose and return the health of the model by computing the Quality of Fit (QoF) metrics/measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted.

Diagnose and return the health of the model by computing the Quality of Fit (QoF) metrics/measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted.

Value parameters

w

the weights on the instances (defaults to null)

y

the actual response/output vector to use (test/full)

yp

the predicted response/output vector (test/full)

Attributes

See also

Regression_WLS Override to add more metrics.

def fit: VectorD

Return the Quality of Fit (QoF) measures corresponding to the labels given. Note, if sse > sst, the model introduces errors and the rSq may be negative, otherwise, R^2 (rSq) ranges from 0 (weak) to 1 (strong). Override to add more quality of fit measures.

Return the Quality of Fit (QoF) measures corresponding to the labels given. Note, if sse > sst, the model introduces errors and the rSq may be negative, otherwise, R^2 (rSq) ranges from 0 (weak) to 1 (strong). Override to add more quality of fit measures.

Attributes

def help: String

Return the help string that describes the Quality of Fit (QoF) metrics/measures.

Return the help string that describes the Quality of Fit (QoF) metrics/measures.

Attributes

See also

Fit for an implementation. Override to correspond to fitLabel.

def rSq0_: Double
def rSq_: Double

Return the coefficient of determination (R^2). Must call diagnose first.

Return the coefficient of determination (R^2). Must call diagnose first.

Attributes

inline def smapeF(y: VectorD, yp: VectorD, e_: VectorD): Double

Return the symmetric Mean Absolute Percentage Error (sMAPE) score. Caveat: y_i = yp_i = 0 => no error => no percentage error

Return the symmetric Mean Absolute Percentage Error (sMAPE) score. Caveat: y_i = yp_i = 0 => no error => no percentage error

Value parameters

e_

the error/residual vector (if null, recompute)

y

the given time-series (must be aligned with the forecast)

yp

the forecasted time-series

Attributes

def sse_: Double

Return the sum of the squares for error (sse). Must call diagnose first.

Return the sum of the squares for error (sse). Must call diagnose first.

Attributes

def summary(x_: MatrixD, fname: Array[String], b: VectorD, vifs: VectorD): String

Produce a QoF summary for a model with diagnostics for each predictor 'x_j' and the overall Quality of Fit (QoF).

Produce a QoF summary for a model with diagnostics for each predictor 'x_j' and the overall Quality of Fit (QoF).

Value parameters

b

the parameters/coefficients for the model

fname

the array of feature/variable names

vifs

the Variance Inflation Factors (VIFs)

x_

the testing/full data/input matrix

Attributes