Skip to content

Commit

Permalink
Define constant for coef_ thresholding
Browse files Browse the repository at this point in the history
  • Loading branch information
briandesilva committed May 13, 2020
1 parent 68310ba commit cce6242
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pysindy/optimizers/sindy_optimizer.py
Expand Up @@ -6,6 +6,9 @@
from pysindy.utils.base import supports_multiple_targets


COEF_THRESHOLD = 1e-14


class SINDyOptimizer(BaseEstimator):
"""
Wrapper class for optimizers/sparse regression methods passed into the SINDy object.
Expand Down Expand Up @@ -49,7 +52,7 @@ def fit(self, x, y):
self.optimizer.fit(x, y)
if not hasattr(self.optimizer, "coef_"):
raise AttributeError("optimizer has no attribute coef_")
self.ind_ = np.abs(self.coef_) > 1e-14
self.ind_ = np.abs(self.coef_) > COEF_THRESHOLD

if self.unbias:
self._unbias(x, y)
Expand Down

0 comments on commit cce6242

Please sign in to comment.