Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #130

Closed
jogisuda opened this issue Oct 9, 2021 · 8 comments
Closed

[BUG] #130

jogisuda opened this issue Oct 9, 2021 · 8 comments

Comments

@jogisuda
Copy link

jogisuda commented Oct 9, 2021

Hi! I was trying to get started with PySindy in Colab, running the following simple tutorial code:

import numpy as np
import pysindy as ps

t = np.linspace(0, 1, 100)
x = 3 * np.exp(-2 * t)
y = 0.5 * np.exp(t)
X = np.stack((x, y), axis=-1)  # First column is x, second is y
model = ps.SINDy(feature_names=["x", "y"])
model.fit(X, t=t)

However, I get the following Error message:

AttributeError Traceback (most recent call last)
in ()
1 model = ps.SINDy(feature_names=["x", "y"])
----> 2 model.fit(X, t=t)

6 frames
/usr/local/lib/python3.7/dist-packages/pysindy/feature_library/polynomial_library.py in fit(self, x, y)
170 )
171 print(n_features)
--> 172 self.n_input_features_ = n_features
173 self.n_output_features_ = sum(1 for _ in combinations)
174 return self

AttributeError: can't set attribute

PySINDy/Python version information:

1.4.3 3.7.12 (default, Sep 10 2021, 00:21:48)
[GCC 7.5.0]

@akaptano
Copy link
Collaborator

akaptano commented Oct 9, 2021

Hi Jogisuda,

Thanks for your interest in using PySINDy! This issue has been reported elsewhere in Issues #124 #125 #129 and it stems from a small incompatibility between PySINDy and the new scikit-learn version 1.0. We have patched this issue on the development branch and will update the main branch in a few weeks. For now, you can see the other Issues for straightforwardly downgrading your scikit-learn version.

Best,
Alan

@akaptano akaptano closed this as completed Oct 9, 2021
@jogisuda
Copy link
Author

jogisuda commented Oct 9, 2021

Thank you!

@mathematicsofpaul
Copy link

Still experiencing this (just for other users to know).

@MattKingShoal
Copy link

Still experiencing this now too

@akaptano
Copy link
Collaborator

@znicolaou and @Jacob-Stevens-Haas did we not patch this in the latest release?

@Jacob-Stevens-Haas
Copy link
Member

Jacob-Stevens-Haas commented Jul 26, 2022

I thought it was patched before I came into the picture - I haven't worked on it.

Maybe it's because I made the last release a 2.0.0-rc, so pip defaults to the last stable version.

I made a 1.x branch before merging my big PR, so that should have the relevant change. I can do a release from that branch and that should update the "stable" version pip sees.

edit: Done, v1.7.1 should be on pypi now once the GH "release" workflow completes. Verified code executes without error in fresh environment with v1.7.1 downloaded from PyPI.

@znicolaou
Copy link
Collaborator

Thanks for taking a look, @akaptano & @Jacob-Stevens-Haas! I'm out of town till next week. I can take a look at some things again soon after I get back.

@RiabovAndrew
Copy link

Hi!
Can be reproduced on 1.7.5 version. 1.7.3 is OK.

jpcurbelo pushed a commit to jpcurbelo/pysindy_fork that referenced this issue May 9, 2024
Rework tutorials, fix git hash logging bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants