LinearModelResult¶
- class LinearModelResult(*args)¶
Result of a LinearModelAlgorithm.
- Parameters:
- inputSample2-d sequence of float
The input sample of a model.
- basis
Basis
Functional basis to estimate the trend.
- design
Matrix
The design matrix .
- outputSample2-d sequence of float
The output sample of a model.
- metaModel
Function
The meta model.
- coefficientssequence of float
The trend coefficients associated to the linear model.
- formulastr
The formula description.
- coefficientsNamessequence of str
The coefficients names of the basis.
- sampleResiduals2-d sequence of float
The residual errors.
- standardizedSampleResiduals2-d sequence of float
The normalized residual errors.
- diagonalGramInversesequence of float
The diagonal of the Gram inverse matrix.
- leveragessequence of float
The leverage score.
- cookDistancessequence of float
Cook’s distances.
- residualsVariancefloat
The unbiased variance estimator of the output observation error.
See also
Methods
Accessor to the least squares method.
Accessor to the Adjusted R-squared test.
getBasis
()Accessor to the basis.
Accessor to the object's name.
Accessor to the coefficients of the linear model of the trend.
Accessor to the coefficients names.
Accessor to the coefficients of standard error.
Accessor to the cook's distances.
Accessor to the degrees of freedom.
Accessor to the design matrix.
Accessor to the diagonal gram inverse matrix.
Accessor to the fitted sample.
Accessor to the formula.
Accessor to the input sample.
Accessor to the leverages.
Accessor to the metamodel.
getName
()Accessor to the object's name.
Accessor to the noise distribution, ie the underlying distribution of the residual.
Accessor to the output sample.
Accessor to the R-squared test.
Accessor to the relative errors.
Accessor to the residuals.
Accessor to the unbiased sample variance of the residuals.
Accessor to the residuals.
Accessor to the standardized residuals.
Returns if intercept is provided in the basis or not.
hasName
()Test if the object is named.
Get the model selection flag.
setInputSample
(sampleX)Accessor to the input sample.
setMetaModel
(metaModel)Accessor to the metamodel.
setName
(name)Accessor to the object's name.
setOutputSample
(sampleY)Accessor to the output sample.
setRelativeErrors
(relativeErrors)Accessor to the relative errors.
setResiduals
(residuals)Accessor to the residuals.
setInvolvesModelSelection
- __init__(*args)¶
- buildMethod()¶
Accessor to the least squares method.
- Returns:
- leastSquaresMethod:
LeastSquaresMethod
The least squares method.
- leastSquaresMethod:
- getAdjustedRSquared()¶
Accessor to the Adjusted R-squared test.
- Returns:
- adjustedRSquaredfloat
Not defined when degrees of freedom is null.
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getCoefficients()¶
Accessor to the coefficients of the linear model of the trend.
- Returns:
- coefficients
Point
- coefficients
- getCoefficientsNames()¶
Accessor to the coefficients names.
- Returns:
- coefficientsNames
Description
- coefficientsNames
- getCoefficientsStandardErrors()¶
Accessor to the coefficients of standard error.
- Returns:
- standardErrors
Point
- standardErrors
- getDegreesOfFreedom()¶
Accessor to the degrees of freedom.
- Returns:
- dofint
Sample size minus basis size, a null value is allowed.
- getDiagonalGramInverse()¶
Accessor to the diagonal gram inverse matrix.
- Returns:
- diagonalGramInverse
Point
- diagonalGramInverse
- getFormula()¶
Accessor to the formula.
- Returns:
- condensedFormulastr
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getNoiseDistribution()¶
Accessor to the noise distribution, ie the underlying distribution of the residual.
- Returns:
- noiseDistribution
Distribution
Not defined when degrees of freedom is null.
- noiseDistribution
- getRSquared()¶
Accessor to the R-squared test.
- Returns:
- rSquaredfloat
- getRelativeErrors()¶
Accessor to the relative errors.
- Returns:
- relativeErrors
Point
The relative errors defined as follows for each output of the model: with the vector of the model’s values and the metamodel’s values.
- relativeErrors
- getResiduals()¶
Accessor to the residuals.
- Returns:
- residuals
Point
The residual values defined as follows for each output of the model: with the model’s values and the metamodel’s values.
- residuals
- getResidualsVariance()¶
Accessor to the unbiased sample variance of the residuals.
- Returns:
- residualsVariancefloat
- getStandardizedResiduals()¶
Accessor to the standardized residuals.
- Returns:
- standardizedResiduals
Sample
- standardizedResiduals
- hasIntercept()¶
Returns if intercept is provided in the basis or not.
- Returns:
- interceptBool
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- involvesModelSelection()¶
Get the model selection flag.
A model selection method can be used to select the coefficients to best predict the output. Model selection can lead to a sparse model.
- Returns:
- involvesModelSelection: bool
True if the method involves a model selection method.
- setInputSample(sampleX)¶
Accessor to the input sample.
- Parameters:
- inputSample
Sample
The input sample.
- inputSample
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setOutputSample(sampleY)¶
Accessor to the output sample.
- Parameters:
- outputSample
Sample
The output sample.
- outputSample
- setRelativeErrors(relativeErrors)¶
Accessor to the relative errors.
- Parameters:
- relativeErrorssequence of float
The relative errors defined as follows for each output of the model: with the vector of the model’s values and the metamodel’s values.
- setResiduals(residuals)¶
Accessor to the residuals.
- Parameters:
- residualssequence of float
The residual values defined as follows for each output of the model: with the model’s values and the metamodel’s values.
Examples using the class¶
Build and validate a linear model