-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Added bias_and_explainability to SageMakerClarifyProcessor #3282
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
Conversation
src/sagemaker/clarify.py
Outdated
experiment_config, | ||
) | ||
|
||
def run_bias_and_explainability(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we see if we can override the existing run() method for this purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for run()
we have different input schema
def run(
self,
inputs: Optional[List["ProcessingInput"]] = None,
outputs: Optional[List["ProcessingOutput"]] = None,
arguments: Optional[List[Union[str, PipelineVariable]]] = None,
wait: bool = True,
logs: bool = True,
job_name: Optional[str] = None,
experiment_config: Optional[Dict[str, str]] = None,
kms_key: Optional[str] = None,
):
Signature of method 'SageMakerClarifyProcessor.run()' does not match signature of the base method in class 'Processor'
We could potentially expose the config generator, but I do not think that's improves customer experience. Let's leave everything as-is - the intetrace/arguments that the customer already knows
49a596e
to
8eb4b01
Compare
I will apply formatting after the PR #3271 gets merged - it partially improves the style already |
8eb4b01
to
2bb714f
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
3300f60
to
121ca9d
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
d54f2bf
to
5dcaca3
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
5dcaca3
to
4fa6f98
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
4fa6f98
to
67708bf
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
6f82a43
to
b2e72d6
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
b2e72d6
to
48131a5
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
b323930
to
76eb325
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
76eb325
to
6fc02f4
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Codecov Report
@@ Coverage Diff @@
## master #3282 +/- ##
==========================================
- Coverage 89.40% 89.04% -0.36%
==========================================
Files 848 203 -645
Lines 72563 18345 -54218
==========================================
- Hits 64877 16336 -48541
+ Misses 7686 2009 -5677
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change in general, minor issues.
model_predicted_label_config: ModelPredictedLabelConfig, | ||
explainability_config: Union[ExplainabilityConfig, List[ExplainabilityConfig]], | ||
bias_config: BiasConfig, | ||
pre_training_methods: Union[str, List[str]] = "all", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of these Union types, I see the intention, but is it worth it to save the user typing [] ? I would prefer if it's a plain list and we check that is not empty. Open to discuss about this and be convinced of the opposite though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying that, instead of making the user to pass "all"
, we can make it ["all"]
?
Actually, I did it this way to be consistent with the current implementation - i.e. with how we expose methods yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean explainability_config: Union[ExplainabilityConfig, List[ExplainabilityConfig]],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it was initially only ExplainabilityConfig
, and we only had SHAPConfig
. But then we added PDPConfig
, and we wanted to let customers be allowed to choose both of them in a single job. So, we made into List[ExplainabilityConfig]
but also kept the original single ExplainabilityConfig
as well to maintain backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this was like that and you just annotated the same type, thanks for catching up with this.
I have restarted PR and Local Mode tests, notebook failures are expected and I can override them. Please have 1 approval from @larroy or @keerthanvasist for us to be able to merge |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
6fc02f4
to
2dc3867
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
model_predicted_label_config: ModelPredictedLabelConfig, | ||
explainability_config: Union[ExplainabilityConfig, List[ExplainabilityConfig]], | ||
bias_config: BiasConfig, | ||
pre_training_methods: Union[str, List[str]] = "all", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this was like that and you just annotated the same type, thanks for catching up with this.
analysis_config, model_config, model_predicted_label_config | ||
) | ||
return analysis_config | ||
|
||
@classmethod | ||
def explainability( | ||
cls, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to maintain consistency, can you use self
instead of cls
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment, Keerthan.self
implies creation of an instance, cls
does not require an instance
This should also be driven by pep8.
The changes in this PR were also present in this one: #3296 Thus, cancelling the PR |
Issue #, if available:
Description of changes:
Added a public method to run both Bias and Explainability in a single job processing
Testing done:
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
unique_name_from_base
to create resource names in integ tests (if appropriate)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.