Skip to content
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

docs: Added comment for evaluation_id to python examples #860

Merged
merged 3 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

# [START aiplatform_sdk_create_and_import_dataset_tabular_bigquery_sample]
def create_and_import_dataset_tabular_bigquery_sample(
display_name: str, project: str, location: str, bigquery_source: str,
display_name: str, project: str, location: str, bq_source: str,
):

aiplatform.init(project=project, location=location)

dataset = aiplatform.TabularDataset.create(
display_name=display_name, bigquery_source=bigquery_source,
display_name=display_name, bq_source=bq_source,
)

dataset.wait()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def test_create_and_import_dataset_tabular_bigquery_sample(
create_and_import_dataset_tabular_bigquery_sample.create_and_import_dataset_tabular_bigquery_sample(
project=constants.PROJECT,
location=constants.LOCATION,
bigquery_source=constants.BIGQUERY_SOURCE,
bq_source=constants.BIGQUERY_SOURCE,
display_name=constants.DISPLAY_NAME,
)

mock_sdk_init.assert_called_once_with(
project=constants.PROJECT, location=constants.LOCATION
)
mock_create_tabular_dataset.assert_called_once_with(
display_name=constants.DISPLAY_NAME, bigquery_source=constants.BIGQUERY_SOURCE,
display_name=constants.DISPLAY_NAME, bq_source=constants.BIGQUERY_SOURCE,
)
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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