-
Notifications
You must be signed in to change notification settings - Fork 881
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
[QUESTION] XGBModel fit method in Darts raises "sample_weight_eval_set's length does not equal eval_set's length" error when using val_sample_weight #2579
Comments
I think
This means that if So, adding
The above code is actually the same one used for |
Thanks for reporting the issue @YutakaJX and also for the investigation @yunakkano. It looks indeed like a bug and I added it to our backlog. PR would always be welcome of course :) |
Describe the issue linked to the documentation
I'm encountering an issue with Darts'
XGBModel
when trying to fit it withval_sample_weight
provided.Specifically, when using
val_sample_weight
, I receive aValueError
indicating that "sample_weight_eval_set's length does not equal eval_set's length", even though the shapes and lengths of the training and validation datasets appear to match.Based on the Darts documentation for XGBModel, the fit method accepts
series
,past_covariates
,sample_weight
,val_series
,val_past_covariates
, andval_sample_weight
, among others. Whilesample_weight
works fine, addingval_sample_weight
consistently raises an error.Here’s a minimal code snippet that reproduces the issue (X is pd.DataFrame that contains covariates, targets and weights. So, splitting first into X_cov, y and w):
The above code produces the following error :
Additional context
If I give
None
as validation datasets, there is no problem to runfit
.If I only set
val_sample_weight
toNone
, there is no problem to runfit
. So, the problem seems to happen only when I setval_sample_weight
to TimeSeries.In addition, the same issue does not occur when using
LightGBMModel
in a similar setup, suggesting a difference in howval_sample_weight
is handled forXGBModel
versusLightGBMModel
.Am I missing something in the code? Any help to resolve this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: