Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Support from_dicts for Tabular Classification and Regression #1331

Merged
merged 17 commits into from
May 9, 2022

Conversation

krshrimali
Copy link
Contributor

@krshrimali krshrimali commented May 6, 2022

What does this PR do?

Partially fixes #1326

  • Tabular Classification and Regression classes now have from_dicts method to load tabular data in the form of dictionaries.
  • Tests have been added for both classification and regression.

About the implementation:

  • We convert the dictionary to a Pandas DataFrame and then call the method for loading a data frame input.

Docs (for reviewers) artifacts: (note: I just pushed a commit to fix a minor typo, will update these links once CI is done uploading)

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@krshrimali krshrimali force-pushed the tabular_classification/from_dict branch from 2be6d77 to 39f4c95 Compare May 6, 2022 10:57
@krshrimali krshrimali force-pushed the tabular_classification/from_dict branch from 19f5082 to 8787f63 Compare May 6, 2022 11:19
flash/tabular/classification/input.py Outdated Show resolved Hide resolved
flash/tabular/classification/input.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #1331 (730f4f2) into master (4a128ce) will increase coverage by 1.59%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1331      +/-   ##
==========================================
+ Coverage   89.86%   91.45%   +1.59%     
==========================================
  Files         287      287              
  Lines       12900    12921      +21     
==========================================
+ Hits        11592    11817     +225     
+ Misses       1308     1104     -204     
Flag Coverage Δ
unittests 91.45% <100.00%> (+1.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/tabular/classification/data.py 97.14% <100.00%> (+0.71%) ⬆️
flash/tabular/classification/input.py 96.66% <100.00%> (+0.51%) ⬆️
flash/tabular/regression/data.py 96.77% <100.00%> (+0.77%) ⬆️
flash/tabular/regression/input.py 95.83% <100.00%> (+0.83%) ⬆️
flash/core/serve/dag/task.py 96.82% <0.00%> (-1.06%) ⬇️
flash/text/question_answering/input.py 95.06% <0.00%> (+2.46%) ⬆️
flash/text/seq2seq/translation/model.py 63.63% <0.00%> (+4.54%) ⬆️
flash/text/question_answering/collate.py 95.29% <0.00%> (+4.70%) ⬆️
flash/text/question_answering/model.py 91.15% <0.00%> (+6.12%) ⬆️
flash/text/classification/collate.py 100.00% <0.00%> (+8.33%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a128ce...730f4f2. Read the comment docs.

@krshrimali krshrimali force-pushed the tabular_classification/from_dict branch from def986a to a42c9de Compare May 9, 2022 05:21
@krshrimali krshrimali changed the title [WIP] Support from_dict for Tabular Classification dataset [WIP] Support from_dict for Tabular Classification and Regression May 9, 2022
@krshrimali krshrimali changed the title [WIP] Support from_dict for Tabular Classification and Regression Support from_dict for Tabular Classification and Regression May 9, 2022
krshrimali added 2 commits May 9, 2022 11:14
…Lightning/lightning-flash into tabular_classification/from_dict
@ethanwharris ethanwharris added this to the 0.8.0 milestone May 9, 2022
@ethanwharris ethanwharris added the enhancement New feature or request label May 9, 2022
@krshrimali krshrimali changed the title Support from_dict for Tabular Classification and Regression Support from_dicts for Tabular Classification and Regression May 9, 2022
Copy link
Collaborator

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

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

LGTM 😃 Small suggestion

CHANGELOG.md Outdated Show resolved Hide resolved
krshrimali and others added 2 commits May 9, 2022 17:46
@ethanwharris ethanwharris enabled auto-merge (squash) May 9, 2022 12:17
@ethanwharris ethanwharris disabled auto-merge May 9, 2022 13:10
@ethanwharris ethanwharris merged commit 5699751 into master May 9, 2022
@ethanwharris ethanwharris deleted the tabular_classification/from_dict branch May 9, 2022 13:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Load tabular classifcation / regression data from lists of dicts
2 participants