use of com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice 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());
}
}
Aggregations