Search in sources :

Example 1 with ModelEvaluationSliceName

use of com.google.cloud.aiplatform.v1.ModelEvaluationSliceName 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());
    }
}
Also used : ModelEvaluationSliceName(com.google.cloud.aiplatform.v1.ModelEvaluationSliceName) ModelEvaluationSlice(com.google.cloud.aiplatform.v1.ModelEvaluationSlice) Slice(com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice) ModelServiceSettings(com.google.cloud.aiplatform.v1.ModelServiceSettings) ModelServiceClient(com.google.cloud.aiplatform.v1.ModelServiceClient) ModelEvaluationSlice(com.google.cloud.aiplatform.v1.ModelEvaluationSlice)

Aggregations

ModelEvaluationSlice (com.google.cloud.aiplatform.v1.ModelEvaluationSlice)1 Slice (com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice)1 ModelEvaluationSliceName (com.google.cloud.aiplatform.v1.ModelEvaluationSliceName)1 ModelServiceClient (com.google.cloud.aiplatform.v1.ModelServiceClient)1 ModelServiceSettings (com.google.cloud.aiplatform.v1.ModelServiceSettings)1