diff --git a/pysindy/optimizers/base.py b/pysindy/optimizers/base.py index a45b9a488..c775837a5 100644 --- a/pysindy/optimizers/base.py +++ b/pysindy/optimizers/base.py @@ -49,6 +49,18 @@ class BaseOptimizer(LinearRegression, ComplexityMixin): copy_X : boolean, optional (default True) If True, X will be copied; else, it may be overwritten. + + Attributes + ---------- + coef_ : array, shape (n_features,) or (n_targets, n_features) + Weight vector(s). + + ind_ : array, shape (n_features,) or (n_targets, n_features) + Array of 0s and 1s indicating which coefficients of the + weight vector have not been masked out. + + history_ : list + History of ``coef_`` over iterations of the optimization algorithm. """ def __init__(self, max_iter=20, normalize=False, fit_intercept=False, copy_X=True): diff --git a/pysindy/optimizers/sr3.py b/pysindy/optimizers/sr3.py index 53dc895bf..1a0acfe24 100644 --- a/pysindy/optimizers/sr3.py +++ b/pysindy/optimizers/sr3.py @@ -74,6 +74,11 @@ class SR3(BaseOptimizer): Weight vector(s) that are not subjected to the regularization. This is the w in the objective function. + history_ : list + History of sparse coefficients. ``history_[k]`` contains the + sparse coefficients (v in the optimization objective function) + at iteration k. + Examples -------- >>> import numpy as np diff --git a/pysindy/optimizers/stlsq.py b/pysindy/optimizers/stlsq.py index eab70efad..04cad3d95 100644 --- a/pysindy/optimizers/stlsq.py +++ b/pysindy/optimizers/stlsq.py @@ -47,12 +47,16 @@ class STLSQ(BaseOptimizer): Attributes ---------- coef_ : array, shape (n_features,) or (n_targets, n_features) - Weight vector(s) + Weight vector(s). ind_ : array, shape (n_features,) or (n_targets, n_features) Array of 0s and 1s indicating which coefficients of the weight vector have not been masked out. + history_ : list + History of ``coef_``. ``history_[k]`` contains the values of + ``coef_`` at iteration k of sequentially thresholded least-squares. + Examples -------- >>> import numpy as np