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

Hello, Gerald. I am trying to running your code on my own dataset. But I got some problems here: #19

Open
17103023 opened this issue Dec 24, 2022 · 1 comment

Comments

@17103023
Copy link

My dataset is similar to yours, with a total of 8 columns and 1681 rows, and the runtime reports such an error

Traceback (most recent call last):
File "train.py", line 109, in
out, eval_res = tasks.eval_forecasting(model, data, train_slice, valid_slice, test_slice, scaler, pred_lens, n_covariate_cols, args.max_train_length-1)
File "/userdata/lwy/CoST-main/tasks/forecasting.py", line 55, in eval_forecasting
lr = eval_protocols.fit_ridge(train_features, train_labels, valid_features, valid_labels)
File "/userdata/lwy/CoST-main/tasks/_eval_protocols.py", line 25, in fit_ridge
lr = Ridge(alpha=alpha).fit(train_features, train_y)
File "/userdata/lwy/.local/lib/python3.8/site-packages/sklearn/linear_model/_ridge.py", line 762, in fit
return super().fit(X, y, sample_weight=sample_weight)
File "/userdata/lwy/.local/lib/python3.8/site-packages/sklearn/linear_model/_ridge.py", line 542, in fit
X, y = self._validate_data(X, y,
File "/userdata/lwy/.local/lib/python3.8/site-packages/sklearn/base.py", line 433, in _validate_data
X, y = check_X_y(X, y, **check_params)
File "/userdata/lwy/.local/lib/python3.8/site-packages/sklearn/utils/validation.py", line 63, in inner_f
return f(*args, **kwargs)
File "/userdata/lwy/.local/lib/python3.8/site-packages/sklearn/utils/validation.py", line 814, in check_X_y
X = check_array(X, accept_sparse=accept_sparse,
File "/userdata/lwy/.local/lib/python3.8/site-packages/sklearn/utils/validation.py", line 63, in inner_f
return f(*args, **kwargs)
File "/userdata/lwy/.local/lib/python3.8/site-packages/sklearn/utils/validation.py", line 669, in check_array
raise ValueError("Found array with %d sample(s) (shape=%s) while a"
ValueError: Found array with 0 sample(s) (shape=(0, 320)) while a minimum of 1 is required.

@crishna0401
Copy link

Hi, it seems the data is not properly loaded. Just print(len(data)) before line 109 in train.py

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

2 participants