Skip to content

[BUG] Problem using ConstrainedSR3 #657

@mickpires

Description

@mickpires

I'm following the youtube tutorial and it seems like ConstrainedSR3 isn't working. I searched in the repo and indeed there's a ConstrainedSR3 function, but when I try to use I get


AttributeError Traceback (most recent call last)
Cell In[27], line 28
25 # 1 * (x0 coefficient) = 28
26 constraint_lhs[1, 1 + n_features] = 1
---> 28 optimizer = ps.ConstrainedSR3(
29 constraint_rhs=constraint_rhs,
30 constraint_lhs=constraint_lhs,
31 reg_weight_lam=0.5,
32 thresholder="l1",
33 )
34 model = ps.SINDy(
35 optimizer=optimizer, feature_library=library
36 )
37 model.fit(x_train_added_noise, t=dt, feature_names=feature_names)

AttributeError: module 'pysindy' has no attribute 'ConstrainedSR3'

I thought it was because it was inside the optimizers module. I tried to use ps.optimizers.ConstrainedSR3, but it didn't work as well.

AttributeError Traceback (most recent call last)
Cell In[30], line 28
25 # 1 * (x0 coefficient) = 28
26 constraint_lhs[1, 1 + n_features] = 1
---> 28 optimizer = ps.optimizers.ConstrainedSR3(
29 constraint_rhs=constraint_rhs,
30 constraint_lhs=constraint_lhs,
31 reg_weight_lam=0.5,
32 thresholder="l1",
33 )
34 model = ps.SINDy(
35 optimizer=optimizer, feature_library=library
36 )
37 model.fit(x_train_added_noise, t=dt, feature_names=feature_names)

AttributeError: module 'pysindy.optimizers' has no attribute 'ConstrainedSR3'

I need some help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions