Skip to content

Commit

Permalink
docs: Added comment for evaluation_id to python examples (#860)
Browse files Browse the repository at this point in the history
* Added comment for evaluation_id to python examples

* docs: Update name of BQ source parameter in samples (#859)

* fix: issue 205934591

* fix:test

* fix:test

Co-authored-by: Andrew Ferlitsch <aferlitsch@google.com>
  • Loading branch information
nayaknishant and andrewferlitsch committed Nov 23, 2021
1 parent f11b598 commit 004bf5f
Show file tree
Hide file tree
Showing 13 changed files with 158 additions and 2 deletions.
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_image_classification_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_image_object_detection_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -24,6 +24,19 @@ def get_model_evaluation_slice_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_tabular_classification_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_tabular_regression_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -17,8 +17,8 @@
import get_model_evaluation_sample

PROJECT_ID = os.getenv("BUILD_SPECIFIC_GCLOUD_PROJECT")
MODEL_ID = "8842430840248991744" # bq all
EVALUATION_ID = "4944816689650806017" # bq all evaluation
MODEL_ID = "626638064948609024" # bq all
EVALUATION_ID = "3002272024979570688" # bq all evaluation


def test_ucaip_generated_get_model_evaluation_sample(capsys):
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_text_classification_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_text_entity_extraction_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_text_sentiment_analysis_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_video_action_recognition_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_video_classification_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def get_model_evaluation_video_object_tracking_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down
Expand Up @@ -23,6 +23,19 @@ def list_model_evaluation_slices_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
"""
To obtain evaluation_id run the following commands where LOCATION
is the region where the model is stored, PROJECT is the project ID,
and MODEL_ID is the ID of your model.
model_client = aiplatform.gapic.ModelServiceClient(
client_options={
'api_endpoint':'LOCATION-aiplatform.googleapis.com'
}
)
evaluations = model_client.list_model_evaluations(parent='projects/PROJECT/locations/LOCATION/models/MODEL_ID')
print("evaluations:", evaluations)
"""
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
Expand Down

0 comments on commit 004bf5f

Please sign in to comment.