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

feat: improve error handling for predict #145

Conversation

lars-reimann
Copy link
Member

Closes #9.

Summary of Changes

  • Use appropriate exception types.
  • Improve messages of raised exception.
  • Improve documentation.

@codecov
Copy link

codecov bot commented Apr 2, 2023

Codecov Report

Merging #145 (724c37b) into main (a311727) will increase coverage by 0.17%.
The diff coverage is 94.11%.

❗ Current head 724c37b differs from pull request most recent head 96a43ad. Consider uploading reports for the commit 96a43ad to get more accurate results

@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   93.32%   93.50%   +0.17%     
==========================================
  Files          36       36              
  Lines        1364     1370       +6     
==========================================
+ Hits         1273     1281       +8     
+ Misses         91       89       -2     
Impacted Files Coverage Δ
src/safeds/ml/classification/_ada_boost.py 95.83% <ø> (ø)
src/safeds/ml/classification/_classifier.py 94.11% <ø> (ø)
src/safeds/ml/classification/_decision_tree.py 95.83% <ø> (ø)
...lassification/_gradient_boosting_classification.py 95.83% <ø> (ø)
...c/safeds/ml/classification/_k_nearest_neighbors.py 96.00% <ø> (ø)
...c/safeds/ml/classification/_logistic_regression.py 95.83% <ø> (ø)
src/safeds/ml/classification/_random_forest.py 95.83% <ø> (ø)
src/safeds/ml/regression/_ada_boost.py 95.83% <ø> (ø)
src/safeds/ml/regression/_decision_tree.py 95.83% <ø> (ø)
...rc/safeds/ml/regression/_elastic_net_regression.py 95.83% <ø> (ø)
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lars-reimann
Copy link
Member Author

lars-reimann commented Apr 2, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 30 0 0 1.12s
✅ PYTHON mypy 30 0 2.21s
✅ PYTHON ruff 30 0 0 0.06s
✅ REPOSITORY git_diff yes no 0.02s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@lars-reimann lars-reimann merged commit a5ff11c into main Apr 2, 2023
@lars-reimann lars-reimann deleted the 9-better-error-message-when-predict-is-called-with-a-table-that-already-contains-the-target branch April 2, 2023 12:56
lars-reimann pushed a commit that referenced this pull request Apr 4, 2023
## [0.9.0](v0.8.0...v0.9.0) (2023-04-04)

### Features

* container for images ([#159](#159)) ([ed7ae34](ed7ae34)), closes [#158](#158)
* improve error handling for `predict` ([#145](#145)) ([a5ff11c](a5ff11c)), closes [#9](#9)
* move `ImputerStrategy` to `safeds.data.tabular.typing` ([#174](#174)) ([205c8e2](205c8e2))
* rename `n_neighbors` to `number_of_neighbors` ([#162](#162)) ([526b96e](526b96e))

### Bug Fixes

* export `TableTransformer` and `InvertibleTableTransformer` ([#135](#135)) ([81c3695](81c3695))
@lars-reimann
Copy link
Member Author

🎉 This PR is included in version 0.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Included in a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better error message when predict() is called with a Table that already contains the target
1 participant