Skip to content

added fitted attr to stat op and checks in executor #333

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

Merged
merged 1 commit into from
May 24, 2023

Conversation

jperez999
Copy link
Collaborator

This PR adds the fitted (bool) attribute to all Stat Operators. This boolean is set to true after an operator has been fit. You can now manually specify to "refit" a fitted StatOperator in the fit method call. And transform checks to ensure all Stat Operators have been fitted before running transform on a graph.

@jperez999 jperez999 added the enhancement New feature or request label May 23, 2023
@jperez999 jperez999 added this to the Merlin 23.06 milestone May 23, 2023
@jperez999 jperez999 requested a review from oliverholworthy May 23, 2023 19:48
@@ -27,6 +27,8 @@ class StatOperator(BaseOperator):
on top of the Operator class.
"""

fitted = False
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still somewhat concerned that this variable needs to be on the instance level instead of the class level. It works in our test case because we only have one op that needs fitting, but I have a hunch this is going to cause weird errors that are difficult to troubleshoot when we have more than one.

Copy link
Member

Choose a reason for hiding this comment

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

Unless we have some code that runs StatOperator.fitted = True, changing the class-level attribute we should be ok? If we're concerned about that, maybe can implement an __init__ method that sets the fitted attribute?

@github-actions
Copy link

Documentation preview

https://nvidia-merlin.github.io/core/review/pr-333

@karlhigley karlhigley merged commit c396eb9 into NVIDIA-Merlin:main May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants