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: Getters for hyperparameters of Regression and Classification models #306

Merged
merged 17 commits into from
May 25, 2023

Conversation

PhilipGutberlet
Copy link
Contributor

Closes #260 .

Summary of Changes

Added properties/getters for the hyperparameters of all Regression and Classification models.

@PhilipGutberlet PhilipGutberlet requested a review from a team as a code owner May 12, 2023 14:16
@PhilipGutberlet PhilipGutberlet linked an issue May 12, 2023 that may be closed by this pull request
@lars-reimann
Copy link
Member

lars-reimann commented May 12, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 26 0 0 1.03s
✅ PYTHON mypy 26 0 2.19s
✅ PYTHON ruff 26 0 0 0.06s
✅ REPOSITORY git_diff yes no 0.03s

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

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Merging #306 (e28dcf9) into main (7803296) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #306   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           44        44           
  Lines         1896      1956   +60     
=========================================
+ Hits          1896      1956   +60     
Impacted Files Coverage Δ
...c/safeds/ml/classical/classification/_ada_boost.py 100.00% <100.00%> (ø)
.../ml/classical/classification/_gradient_boosting.py 100.00% <100.00%> (ø)
...l/classical/classification/_k_nearest_neighbors.py 100.00% <100.00%> (ø)
...feds/ml/classical/classification/_random_forest.py 100.00% <100.00%> (ø)
...lassical/classification/_support_vector_machine.py 100.00% <100.00%> (ø)
src/safeds/ml/classical/regression/_ada_boost.py 100.00% <100.00%> (ø)
...ml/classical/regression/_elastic_net_regression.py 100.00% <100.00%> (ø)
...feds/ml/classical/regression/_gradient_boosting.py 100.00% <100.00%> (ø)
...ds/ml/classical/regression/_k_nearest_neighbors.py 100.00% <100.00%> (ø)
...afeds/ml/classical/regression/_lasso_regression.py 100.00% <100.00%> (ø)
... and 3 more

@zzril
Copy link
Contributor

zzril commented May 19, 2023

The IDE complains about missing docstrings for the getter methods.
(I think you can just copy and paste them from the init methods.)

May want to discuss this in a new issue, though. (Or possibly try to automate this in the mkdocs functionality.)
So, we will not consider this as a requirement for accepting this PR.

@Marsmaennchen221 Marsmaennchen221 self-requested a review May 19, 2023 09:18
Copy link
Contributor

@Marsmaennchen221 Marsmaennchen221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add docstrings to the property methods which describe the parameter that is returned

Copy link
Contributor

@zzril zzril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The c parameter for the SupportVectorMachine also needs a getter. (Both in classification and regression.)

@PhilipGutberlet
Copy link
Contributor Author

The IDE complains about missing docstrings for the getter methods. (I think you can just copy and paste them from the init methods.)

May want to discuss this in a new issue, though. (Or possibly try to automate this in the mkdocs functionality.) So, we will not consider this as a requirement for accepting this PR.

Would be a new issue.

@PhilipGutberlet PhilipGutberlet merged commit 5c7a662 into main May 25, 2023
@PhilipGutberlet PhilipGutberlet deleted the 260-getters-for-hyperparameters-of-models branch May 25, 2023 18:39
lars-reimann pushed a commit that referenced this pull request Jun 1, 2023
## [0.13.0](v0.12.0...v0.13.0) (2023-06-01)

### Features

* add `Choice` class for possible values of hyperparameter ([#325](#325)) ([d511c3e](d511c3e)), closes [#264](#264)
* Add `RangeScaler` transformer ([#310](#310)) ([f687840](f687840)), closes [#141](#141)
* Add methods that tell which columns would be affected by a transformer ([#304](#304)) ([3933b45](3933b45)), closes [#190](#190)
* Getters for hyperparameters of Regression and Classification models ([#306](#306)) ([5c7a662](5c7a662)), closes [#260](#260)
* improve error handling of table ([#308](#308)) ([ef87cc4](ef87cc4)), closes [#147](#147)
* Remove warnings thrown in new `Transformer` methods ([#324](#324)) ([ca046c4](ca046c4)), closes [#323](#323)
@lars-reimann
Copy link
Member

🎉 This PR is included in version 0.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Jun 1, 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.

Getters for hyperparameters of models
5 participants