class Fit extends AnyRef
The Fit
class provides methods to determine basic quality of fit measures.
- Alphabetic
- By Inheritance
- Fit
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Fit(y: VectoD, n: Int, df: (Double, Double) = (0.0, 0.0))
- y
the values in the m-dimensional response vector
- n
the number of parameters (b.dim)
- df
the degrees of freedom (df._1, df._2) for (regression, error)
Value Members
- val df: (Double, Double)
-
def
diagnose(e: VectoD, w: VectoD = null, yp: VectoD = null): Unit
Given the error/residual vector, compute the quality of fit measures.
Given the error/residual vector, compute the quality of fit measures.
- e
the corresponding m-dimensional error vector (y - yp)
- w
the weights on the instances
- yp
the predicted response vector (x * b)
-
def
f_(z: Double): String
Format a double value.
Format a double value.
- z
the double value to format
-
def
fit: VectoD
Return the quality of fit including 'sst', 'sse', 'mse0', rmse', 'mae', 'rSq', 'df._2', 'rBarSq', 'fStat', 'aic', 'bic'.
Return the quality of fit including 'sst', 'sse', 'mse0', rmse', 'mae', 'rSq', 'df._2', 'rBarSq', 'fStat', 'aic', 'bic'. 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). Note that 'rSq' is the number 5 measure. Override to add more quality of fit measures.
-
def
fitLabel: Seq[String]
Return the labels for the quality of fit measures.
Return the labels for the quality of fit measures. Override to add more quality of fit measures.
-
def
fitMap: Map[String, String]
Build a map of quality of fit measures (use of
LinedHashMap
makes it ordered).Build a map of quality of fit measures (use of
LinedHashMap
makes it ordered). Override to add more quality of fit measures. - val index_rSq: Int
-
def
mse_: Double
Return the mean of squares for error (sse / df._2).
Return the mean of squares for error (sse / df._2). Must call diagnose first.
-
def
sumCoeff(b: VectoD, stdErr: VectoD = null): String
Produce the summary report portion for the cofficients.
Produce the summary report portion for the cofficients.
- b
the parameters/coefficients for the model
-
def
summary(b: VectoD, stdErr: VectoD = null): String
Produce a summary report with diagnostics for each predictor 'x_j' and the overall quality of fit.
Produce a summary report with diagnostics for each predictor 'x_j' and the overall quality of fit.
- b
the parameters/coefficients for the model