Skip to content

Adding ModelEvaluation class#2

Open
sararob wants to merge 18 commits into
mainfrom
model-eval
Open

Adding ModelEvaluation class#2
sararob wants to merge 18 commits into
mainfrom
model-eval

Conversation

@sararob

@sararob sararob commented Apr 13, 2022

Copy link
Copy Markdown
Owner

Started work on ModelEvaluation class (without pipeline-based services). Added

  • model_evaluation/model_evaluation.py
  • list_model_evaluations and get_model_evaluation methods to models.py
  • Initial tests in test_model_evaluation.py and test_models.py

_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?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We can have a separate API for summary metrics.

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?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread google/cloud/aiplatform/models.py Outdated
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should be module level import.

Comment thread google/cloud/aiplatform/models.py Outdated
upload_request_timeout=upload_request_timeout,
)

# TODO: should this have a sync param?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread google/cloud/aiplatform/models.py Outdated
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[auth_credentials.Credentials] = None,
) -> Optional[List["ModelEvaluation"]]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It doesn't seem like Optional is needed here.

Comment thread google/cloud/aiplatform/models.py Outdated
# TODO: same question about a sync param
def get_model_evaluation(
self,
evaluation_name: Optional[str] = None,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread google/cloud/aiplatform/models.py Outdated
)

# TODO: should this have a sync param?
@classmethod

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Preference for an instance method. It won't require any arguments.

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.

2 participants