use of com.google.cloud.aiplatform.v1.ModelServiceSettings in project java-aiplatform by googleapis.
the class GetModelEvaluationImageObjectDetectionSample method getModelEvaluationImageObjectDetectionSample.
static void getModelEvaluationImageObjectDetectionSample(String project, String modelId, String evaluationId) throws IOException {
ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
String location = "us-central1";
ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
ModelEvaluation modelEvaluation = modelServiceClient.getModelEvaluation(modelEvaluationName);
System.out.println("Get Model Evaluation Image Object Detection Response");
System.out.format("\tName: %s\n", modelEvaluation.getName());
System.out.format("\tMetrics Schema Uri: %s\n", modelEvaluation.getMetricsSchemaUri());
System.out.format("\tMetrics: %s\n", modelEvaluation.getMetrics());
System.out.format("\tCreate Time: %s\n", modelEvaluation.getCreateTime());
System.out.format("\tSlice Dimensions: %s\n", modelEvaluation.getSliceDimensionsList());
}
}
use of com.google.cloud.aiplatform.v1.ModelServiceSettings in project java-aiplatform by googleapis.
the class GetModelEvaluationSample method getModelEvaluationSample.
static void getModelEvaluationSample(String project, String modelId, String evaluationId) throws IOException {
ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
String location = "us-central1";
ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
ModelEvaluation modelEvaluation = modelServiceClient.getModelEvaluation(modelEvaluationName);
System.out.println("Get Model Evaluation Response");
System.out.format("Model Name: %s\n", modelEvaluation.getName());
System.out.format("Metrics Schema Uri: %s\n", modelEvaluation.getMetricsSchemaUri());
System.out.format("Metrics: %s\n", modelEvaluation.getMetrics());
System.out.format("Create Time: %s\n", modelEvaluation.getCreateTime());
System.out.format("Slice Dimensions: %s\n", modelEvaluation.getSliceDimensionsList());
}
}
use of com.google.cloud.aiplatform.v1.ModelServiceSettings in project java-aiplatform by googleapis.
the class GetModelEvaluationSliceSample method getModelEvaluationSliceSample.
static void getModelEvaluationSliceSample(String project, String modelId, String evaluationId, String sliceId) throws IOException {
ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
String location = "us-central1";
ModelEvaluationSliceName modelEvaluationSliceName = ModelEvaluationSliceName.of(project, location, modelId, evaluationId, sliceId);
ModelEvaluationSlice modelEvaluationSlice = modelServiceClient.getModelEvaluationSlice(modelEvaluationSliceName);
System.out.println("Get Model Evaluation Slice Response");
System.out.format("Model Evaluation Slice Name: %s\n", modelEvaluationSlice.getName());
System.out.format("Metrics Schema Uri: %s\n", modelEvaluationSlice.getMetricsSchemaUri());
System.out.format("Metrics: %s\n", modelEvaluationSlice.getMetrics());
System.out.format("Create Time: %s\n", modelEvaluationSlice.getCreateTime());
Slice slice = modelEvaluationSlice.getSlice();
System.out.format("Slice Dimensions: %s\n", slice.getDimension());
System.out.format("Slice Value: %s\n", slice.getValue());
}
}
use of com.google.cloud.aiplatform.v1.ModelServiceSettings in project java-aiplatform by googleapis.
the class GetModelEvaluationTextClassificationSample method getModelEvaluationTextClassificationSample.
static void getModelEvaluationTextClassificationSample(String project, String modelId, String evaluationId) throws IOException {
ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
String location = "us-central1";
ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
ModelEvaluation modelEvaluation = modelServiceClient.getModelEvaluation(modelEvaluationName);
System.out.println("Get Model Evaluation Text Classification Response");
System.out.format("\tModel Name: %s\n", modelEvaluation.getName());
System.out.format("\tMetrics Schema Uri: %s\n", modelEvaluation.getMetricsSchemaUri());
System.out.format("\tMetrics: %s\n", modelEvaluation.getMetrics());
System.out.format("\tCreate Time: %s\n", modelEvaluation.getCreateTime());
System.out.format("\tSlice Dimensions: %s\n", modelEvaluation.getSliceDimensionsList());
}
}
Aggregations