Adding ModelEvaluation class#2
Open
sararob wants to merge 18 commits into
Open
Conversation
sasha-gitg
reviewed
Apr 13, 2022
| _parse_resource_name_method = "parse_model_evaluation_path" | ||
| _format_resource_name_method = "model_evaluation_path" | ||
|
|
||
| # TODO: should this have an option for only returning summary metrics? |
There was a problem hiding this comment.
We can have a separate API for summary metrics.
sasha-gitg
reviewed
Apr 13, 2022
| if self._gca_resource.metrics: | ||
| return self.to_dict()["metrics"] | ||
|
|
||
| # TODO: can this be initialized with an eval ID only if a model is passed in? |
There was a problem hiding this comment.
sasha-gitg
reviewed
Apr 13, 2022
| from google.cloud.aiplatform import models | ||
| from google.cloud.aiplatform import utils | ||
| from google.cloud.aiplatform.utils import gcs_utils | ||
| from google.cloud.aiplatform.model_evaluation import ModelEvaluation |
sasha-gitg
reviewed
Apr 13, 2022
| upload_request_timeout=upload_request_timeout, | ||
| ) | ||
|
|
||
| # TODO: should this have a sync param? |
There was a problem hiding this comment.
No, there's no long running resource.
But you will want to call self.wait() in the body if the Model was created with sync=False upstream.
sasha-gitg
reviewed
Apr 13, 2022
| project: Optional[str] = None, | ||
| location: Optional[str] = None, | ||
| credentials: Optional[auth_credentials.Credentials] = None, | ||
| ) -> Optional[List["ModelEvaluation"]]: |
There was a problem hiding this comment.
It doesn't seem like Optional is needed here.
sasha-gitg
reviewed
Apr 13, 2022
| # TODO: same question about a sync param | ||
| def get_model_evaluation( | ||
| self, | ||
| evaluation_name: Optional[str] = None, |
There was a problem hiding this comment.
It seems like this should evaluation_id because the model_id is already known because of the instance. Additionally no need for project/location/credentials since that is already set at construction of this object.
sasha-gitg
reviewed
Apr 13, 2022
| ) | ||
|
|
||
| # TODO: should this have a sync param? | ||
| @classmethod |
There was a problem hiding this comment.
Preference for an instance method. It won't require any arguments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Started work on ModelEvaluation class (without pipeline-based services). Added
model_evaluation/model_evaluation.pylist_model_evaluationsandget_model_evaluationmethods tomodels.pytest_model_evaluation.pyandtest_models.py