eqdisco.models.SparseRegressor#

class eqdisco.models.SparseRegressor(library=None, degree=2, functions=(), interactions=True, method='stlsq', threshold=0.05, ridge=0.0, max_terms=None, criterion='bic', err_tol=0.0001, feature_names=None)[source]#

Bases: BaseEstimator, RegressorMixin

Sparse regression over a library of candidate terms.

Parameters:
librarylist of Expression or str, optional

Candidate terms; by default make_library() with degree and functions.

degreeint, default=2
functionssequence of str, default=()
interactionsbool, default=True
method{“stlsq”, “lasso”, “frols”, “best_subset”}
  • stlsq – thresholded least squares with threshold;

  • lasso – sklearn.linear_model.LassoCV and refit of the support;

  • frols – forward orthogonal least squares, stopped by criterion;

  • best_subset – all subsets of up to max_terms terms, minimum BIC.

thresholdfloat, default=0.05
ridgefloat, default=0.0
max_termsint, optional
criterion{“bic”, “aic”, “err”}, default=”bic”

Stopping rule of frols.

Attributes:
equation_Equation
terms_list of Expression

The library.

coef_, intercept_ndarray, float
support_ndarray of bool