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: specify features and target when creating a TaggedTable #114

Conversation

lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented Mar 29, 2023

Closes #27 .

Summary of Changes

A user can now optionally specify the features of a TaggedTable explicitly. If the features are not specified, all columns except the target are considered features.

The predict method of classifiers/regressors only uses the features for prediction. The other columns are still included in the output, however. This is, for example, useful to include an ID column in the table created by predict.

@lars-reimann lars-reimann linked an issue Mar 29, 2023 that may be closed by this pull request
@lars-reimann
Copy link
Member Author

lars-reimann commented Mar 29, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 59 0 0 1.39s
✅ PYTHON flake8 59 0 0.87s
✅ PYTHON isort 59 0 0 0.27s
✅ PYTHON mypy 59 0 2.24s
✅ PYTHON pylint 59 0 4.67s
✅ 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 force-pushed the 27-specify-features-and-target-when-creating-a-supervised-dataset branch from 46334e0 to 0013086 Compare March 29, 2023 12:36
@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Merging #114 (a66289f) into main (b92bba5) will increase coverage by 0.78%.
The diff coverage is 94.29%.

@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   92.30%   93.08%   +0.78%     
==========================================
  Files          35       36       +1     
  Lines        1182     1258      +76     
==========================================
+ Hits         1091     1171      +80     
+ Misses         91       87       -4     
Impacted Files Coverage Δ
...rc/safeds/data/tabular/containers/_tagged_table.py 72.22% <75.00%> (+9.25%) ⬆️
src/safeds/ml/_util_sklearn.py 92.30% <87.50%> (+12.99%) ⬆️
src/safeds/data/tabular/transformation/_imputer.py 92.75% <91.11%> (-5.21%) ⬇️
src/safeds/data/tabular/containers/_table.py 91.13% <91.66%> (-0.21%) ⬇️
.../data/tabular/transformation/_table_transformer.py 93.33% <93.33%> (ø)
src/safeds/data/tabular/transformation/__init__.py 100.00% <100.00%> (ø)
...feds/data/tabular/transformation/_label_encoder.py 100.00% <100.00%> (+8.88%) ⬆️
...ds/data/tabular/transformation/_one_hot_encoder.py 100.00% <100.00%> (+4.65%) ⬆️
src/safeds/ml/classification/_ada_boost.py 100.00% <100.00%> (ø)
src/safeds/ml/classification/_decision_tree.py 100.00% <100.00%> (ø)
... 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 lars-reimann force-pushed the 27-specify-features-and-target-when-creating-a-supervised-dataset branch from 6c0de34 to a010ec8 Compare March 29, 2023 19:56
@lars-reimann lars-reimann marked this pull request as ready for review March 29, 2023 20:13
@lars-reimann lars-reimann requested a review from a team as a code owner March 29, 2023 20:13
@lars-reimann lars-reimann merged commit 95e1fc7 into main Mar 29, 2023
@lars-reimann lars-reimann deleted the 27-specify-features-and-target-when-creating-a-supervised-dataset branch March 29, 2023 20:14
lars-reimann pushed a commit that referenced this pull request Mar 29, 2023
## [0.7.0](v0.6.0...v0.7.0) (2023-03-29)

### Features

* `sort_rows` of a `Table` ([#104](#104)) ([20aaf5e](20aaf5e)), closes [#14](#14)
* add `_file` suffix to methods interacting with files ([#103](#103)) ([ec011e4](ec011e4))
* improve transformers for tabular data ([#108](#108)) ([b18a06d](b18a06d)), closes [#61](#61) [#90](#90)
* remove `OrdinalEncoder` ([#107](#107)) ([b92bba5](b92bba5)), closes [#61](#61)
* specify features and target when creating a `TaggedTable` ([#114](#114)) ([95e1fc7](95e1fc7)), closes [#27](#27)
* swap `name` and `data` parameters of `Column` ([#105](#105)) ([c2f8da5](c2f8da5))
@lars-reimann
Copy link
Member Author

🎉 This PR is included in version 0.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Specify features and target when creating a TaggedTable
1 participant