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] Cannot run Scaler() #683

Closed
albienaculan14 opened this issue Oct 20, 2023 · 4 comments · Fixed by #692
Closed

[BUG] Cannot run Scaler() #683

albienaculan14 opened this issue Oct 20, 2023 · 4 comments · Fixed by #692
Labels
bug Something isn't working

Comments

@albienaculan14
Copy link

I re-ran the Lorenz attractor notebook from giotto-tda examples. In the part using scaler,

diagramScaler = Scaler()

X_scaled = diagramScaler.fit_transform(X_diagrams)

diagramScaler.plot(X_scaled, sample=window_number)

I get the following error:

TypeError: Parameter function is of type <class 'numpy._ArrayFunctionDispatcher'> while it should be of type (<class 'function'>, <class 'NoneType'>).

I also ran this using the data that I have and the Scaler method also produced the same error.

@albienaculan14 albienaculan14 added the bug Something isn't working label Oct 20, 2023
@taoshen1
Copy link

I have the same question

@Lunamos
Copy link

Lunamos commented Nov 13, 2023

The same TypeError also happens in Lab.fit_transform_resample(X, X) in time_series_forecasting.ipynb.

@beew
Copy link

beew commented Nov 30, 2023

What is your numpy version? There is no update for a while, probably new versions of libraries break backward compatibility. It works here with

Python implementation: CPython
Python version       : 3.10.9
IPython version      : 8.13.1

sklearn: 1.2.2

plotly: 5.13.1
openml: 0.13.0
numpy : 1.23.5

Almost all examples are broken with scikit-learn 1.3.x. I hope there is an update as this is a very interesting software,

@hawkinglai
Copy link

It is easily to be solved using the lambda x: np.max(x), be like:

Scaler(metric='persistence_image', function=lambda x: np.max(x), n_jobs=-1).fit_transform(persistence_diagrams)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants