SimpleRegressor
- class pyoptex.analysis.estimators.simple_model.SimpleRegressor(factors=(), Y2X=<function identityY2X>, random_effects=(), conditional=False)[source]
A simple linear regressor implementing the
RegressionMixinandConditionalRegressionMixininterfaces.Permits to fit a simple model provided in Y2X with optionally random effects.
Note
It includes all parameters and attributes from
RegressionMixinandConditionalRegressionMixin- __init__(factors=(), Y2X=<function identityY2X>, random_effects=(), conditional=False)[source]
Simple regression model.
Parameters
- factorslist(
Factor) A list of factors to be used during fitting. It contains the categorical encoding, continuous normalization, etc.
- Y2Xfunc(Y)
The function to transform a design matrix Y to a model matrix X.
- random_effectslist(str)
The names of any random effect columns. Every random effect is interpreted as a string column and encoded using effect encoding.
- conditionalbool
Whether to create a conditional model or not.
Methods
SimpleRegressor.fit(X, y)Fits the data.
SimpleRegressor.formula([labels])Creates the prediction formula of the fit for the encoded and normalized data.
Get metadata routing of this object.
SimpleRegressor.get_params([deep])Get parameters for this estimator.
Creates the prediction formula of the fit for the encoded and normalized data.
Prediction variances for the new values specified in X.
Predict on new data after fitting.
Preprocesses before fitting the data.
Preprocessing the incoming data before prediction.
SimpleRegressor.score(X, y[, sample_weight])Return coefficient of determination on test data.
SimpleRegressor.set_params(**params)Set the parameters of this estimator.
SimpleRegressor.set_score_request(*[, ...])Configure whether metadata should be requested to be passed to the
scoremethod.Generates a summary of the fit in case it was stored during training in the fit_ attribute.
Attributes
Alias for
information_matrixAlias for
inv_information_matrixAlias for
obs_covAlias for
inv_obs_covThe information matrix of the fitted data.
The inverse of the information matrix.
The inverse of the observation covariance matrix.
Checks whether the regressor has been fitted.
The observation covariance matrix \(V = var(Y)\).
The total variance on the normalized y-values.
- factorslist(