-
Notifications
You must be signed in to change notification settings - Fork 900
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 :) |
Hi, I am new to this project and find this issue interesting. Can I solve it? |
Hi @KylinSchmidt. Of course, we'd be very happy about the contribution! :) I can assign this issue to you. This guide explains all the steps for contributing. If you need any help, let me know. |
@KylinSchmidt, just wanted to check in on this issue. Are you still open to contribute? |
@dennisbader Yes, I’m open to contributing! I’m still interested in this issue and plan to address this issue soon. |
@dennisbader @KylinSchmidt Hi, both. Apology for not responding for a while, and happy to hear that @KylinSchmidt could contribute to this issue as I am a bit too busy for my own projects. After some more investigation, I think the fundamental solution to this issue is NOT overriding the In my opinion, the corection would be just to add list brackets to the
This way, the @dennisbader |
@dennisbader Hi, I just wanted to follow up on the pull request I submitted last week (#2626) and check if there’s anything further I need to do. |
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: