Skip to content

Warn when encoders are ignored by fit/predict_from_dataset - #3203

Closed
webzuweb wants to merge 1 commit into
unit8co:masterfrom
webzuweb:docs/encoders-from-dataset-warning
Closed

webzuweb wants to merge 1 commit into
unit8co:masterfrom
webzuweb:docs/encoders-from-dataset-warning

Conversation

@webzuweb

Copy link
Copy Markdown
Contributor

Fixes #3006.

Summary

add_encoders is only applied when training/predicting via fit()/predict(). When using fit_from_dataset()/predict_from_dataset(), encoders are silently ignored, which is a blind spot for users.

Per the discussion in #3006, this PR adds a logger.warning whenever fit_from_dataset()/predict_from_dataset() is called on a model initialized with add_encoders, and documents the behavior in both docstrings.

Changes

  • TorchForecastingModel.fit_from_dataset(): warn + docstring note when self.add_encoders is set.
  • TorchForecastingModel.predict_from_dataset(): warn + docstring note when self.add_encoders is set.
  • Tests: test_encoders_ignored_in_from_dataset_warns and test_encoders_not_set_from_dataset_no_warn.

No behavior change for models without encoders.

)

add_encoders is only applied when training/predicting via fit()/predict().
When using fit_from_dataset()/predict_from_dataset(), encoders are silently
ignored. Add a warning and document this behavior in both docstrings.
@dennisbader

Copy link
Copy Markdown
Collaborator

Hi @webzuweb and thanks for the PR. Closing it however since it's a duplicate of #3086.

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

Successfully merging this pull request may close these issues.

[Feature] Improve handling & documentation of encoders and categorical static covariates in .fit_from_dataset()

2 participants