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

responsibleai: Add FeatureMetadata class and related tests #1604

Merged
merged 3 commits into from
Aug 5, 2022

Conversation

gaugup
Copy link
Contributor

@gaugup gaugup commented Aug 3, 2022

Description

This PR adds the FeatureMetadata class and the related unit tests. This class will allow users specify what are the various types of features that are present in their data. This will allow the responsibleai SDK to better handle the different types of features.
In the PR, the following types of feature list have been added. More feature type lists can be added to this class later.

    def __init__(self, identity_feature_name: Optional[str] = None,
                 sensitive_features: Optional[List[str]] = None,
                 datetime_features: Optional[List[str]] = None,
                 categorical_features: Optional[List[str]] = None,
                 dropped_features: Optional[List[str]] = None):
        """Placeholder class for feature metadata provided by the user.

        :param identity_feature_name: Name of the feature which helps to
                                      uniquely identify a row or instance
                                      in user input dataset.
        :type identity_feature_name: Optional[str]
        :param datetime_features: List of datetime features in the
                                  user input dataset.
        :type datetime_features: Optional[List[str]]
        :param categorical_features: List of categorical features in the
                                     user input dataset.
        :type categorical_features: Optional[List[str]]
        :param dropped_features: List of features that were dropped by the
                                 the user during training of their model.
        :type dropped_features: Optional[List[str]]

Checklist

  • I have added screenshots above for all UI changes.
  • I have added e2e tests for all UI changes.
  • Documentation was updated if it was needed.

@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2022

Codecov Report

Merging #1604 (3482e27) into main (b80f2ac) will increase coverage by 8.59%.
The diff coverage is 96.00%.

@@            Coverage Diff             @@
##             main    #1604      +/-   ##
==========================================
+ Coverage   80.35%   88.95%   +8.59%     
==========================================
  Files          41      111      +70     
  Lines        1685     5440    +3755     
==========================================
+ Hits         1354     4839    +3485     
- Misses        331      601     +270     
Flag Coverage Δ
unittests 88.95% <96.00%> (+8.59%) ⬆️

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

Impacted Files Coverage Δ
responsibleai/responsibleai/feature_metadata.py 96.00% <96.00%> (ø)
...ponsibleai/responsibleai/_tools/shared/versions.py 100.00% <0.00%> (ø)
...tabalanceanalysis/distribution_balance_measures.py 100.00% <0.00%> (ø)
...nsibleai/responsibleai/_managers/causal_manager.py 100.00% <0.00%> (ø)
...sponsibleai/responsibleai/managers/base_manager.py 95.23% <0.00%> (ø)
responsibleai/responsibleai/_internal/__init__.py 100.00% <0.00%> (ø)
...erroranalysis/_internal/error_analyzer/__init__.py 100.00% <0.00%> (ø)
...ibleai/_tools/causal/dashboard_schemas/__init__.py 100.00% <0.00%> (ø)
responsibleai/responsibleai/__init__.py 100.00% <0.00%> (ø)
...leai/responsibleai/databalanceanalysis/__init__.py 100.00% <0.00%> (ø)
... and 60 more

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

@gaugup gaugup enabled auto-merge (squash) August 5, 2022 13:53
@gaugup gaugup merged commit ad73992 into main Aug 5, 2022
@gaugup gaugup deleted the gaugup/AddFeatureMetadataClass branch August 5, 2022 14:56
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.

3 participants