Model
- class pyoptex.analysis.estimators.sams.models.model.Model(X, y, forced=None, mode='weak', dep=None)[source]
Base class of a model specifying sampling and mutation functionalities in the SAMS algorithm.
This class can be extended by overwriting the
fitfunction.Attributes
- Xnp.array(2d)
The encoded, normalized model matrix of the data
- ynp.array(1d)
The output variable.
- forcednp.array(1d)
Any terms that must be included in the model.
- modeNone or ‘weak’ or ‘strong’
The heredity model during sampling.
- depnp.array(2d)
The dependency matrix of size (N, N) with N the number of terms in the encoded model (output from Y2X). Term i depends on term j if dep(i, j) = true.
- __init__(X, y, forced=None, mode='weak', dep=None)[source]
Initialize of the base model in the SAMS algorithm.
Parameters
- Xnp.array(2d)
The encoded, normalized model matrix of the data
- ynp.array(1d)
The output variable.
- forcednp.array(1d)
Any terms that must be included in the model.
- modeNone or ‘weak’ or ‘strong’
The heredity model during sampling.
- depnp.array(2d)
The dependency matrix of size (N, N) with N the number of terms in the encoded model (output from Y2X). Term i depends on term j if dep(i, j) = true.
Methods
Model.fit(model)Fit a regression model on the current terms specified by model.
Model.init(model)Create a random model by sequential sampling.
Model.mutate(model)Mutate the model by removing atleast one term and replacing it.