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

standard scaler in a pipeline with CluStream returns zero values #1616

Open
Gelso22 opened this issue Sep 16, 2024 · 1 comment
Open

standard scaler in a pipeline with CluStream returns zero values #1616

Gelso22 opened this issue Sep 16, 2024 · 1 comment

Comments

@Gelso22
Copy link

Gelso22 commented Sep 16, 2024

river version: 0.21.1
Python version: 3.12.3
Operating system: windows

Hello,

I dont' understand where to put the function degub_one to inspect the pipeline respect to loop of training? as your example here . Do I have to use it inside a loop with learn_one(x) funtion?

And also I am not su sure why I obtain Inf values of silhoutte metric with the function progressive_val_score

Data are attached below.

from river import stream
from river import compose
from river import metrics
from river import evaluate


dataset_stock = stream.iter_csv('data.csv',  drop=['Date'], converters=diz_conversion)
 # diz onversione just conver all numeric cols in float 

for x, _ in dataset_stock:
    print(x)
# get the last line of data 

from river import cluster
from river import preprocessing

clustream = cluster.CluStream(
    n_macro_clusters=3,
    max_micro_clusters=50, time_window=20,
    seed=0
)
model = compose.Pipeline(
    preprocessing.StandardScaler(),
    clustream
)
clu_metric = metrics.Silhouette()
print(model.debug_one(x))  # here I get all values equals 0 after rescaling them. 


evaluate.progressive_val_score(dataset_stock, model, clu_metric, print_every=50) # here I get inf values of silhoutte

Thanks!

@Gelso22
Copy link
Author

Gelso22 commented Sep 16, 2024

data.csv

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

1 participant