Skip to content

Add OneHotEncoding CAG pattern #2387

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

Open
frances-h opened this issue Feb 25, 2025 · 0 comments · Fixed by #2414 · May be fixed by #2440
Open

Add OneHotEncoding CAG pattern #2387

frances-h opened this issue Feb 25, 2025 · 0 comments · Fixed by #2414 · May be fixed by #2440
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@frances-h
Copy link
Contributor

Problem Description

As we've built up our multi-table CAG patterns, we'd like to convert our each of our existing single table constraints to use the new CAG framework.

Expected behavior

Add the OneHotEncoding CAG pattern. This CAG should inherit from the base CAG class. This CAG should copy the functionality of the existing constraint, much of _fit, _transform, and _reverse_transform should be able to be directly copied without significant logical rewrites.

Args
column_name (str or list[str]): Same as the constraint
table_name (str, optional): The name of the table to apply the CAG pattern to.

Expected Functionality

_validate_pattern_with_metadata

  • If no table_name is provided, the metadata must only contain a single table (this should be considered the target table)
  • Validate that the columns in column_names exist in the table in the metadata.

_validate_pattern_with_data

  • Validate that the data matches a one hot encoding scheme.

_get_updated_metadata

  • Return the original metadata

_fit

  • Same logic as the constraint (do nothing)

_is_valid

  • Same logic as the constraint

_transform

  • Same logic as the constraint (do nothing)

_reverse_transform

  • Same logic as the constraint

Additional context

@frances-h frances-h added the feature request Request for a new feature label Feb 25, 2025
@fealho fealho self-assigned this Mar 10, 2025
@fealho fealho added this to the 1.18.1 milestone Mar 10, 2025
@amontanez24 amontanez24 modified the milestones: 1.19.0, 1.19.1 Mar 10, 2025
@R-Palazzo R-Palazzo linked a pull request Apr 1, 2025 that will close this issue
@amontanez24 amontanez24 modified the milestones: 1.20.0, 1.21.0 Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants