Search in sources :

Example 16 with ModelEvaluation

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

Example 17 with ModelEvaluation

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

Example 18 with ModelEvaluation

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

Aggregations

ModelEvaluation (com.google.cloud.aiplatform.v1.ModelEvaluation)11 ModelEvaluationName (com.google.cloud.aiplatform.v1.ModelEvaluationName)11 ModelServiceClient (com.google.cloud.aiplatform.v1.ModelServiceClient)11 ModelServiceSettings (com.google.cloud.aiplatform.v1.ModelServiceSettings)11 AutoMlClient (com.google.cloud.automl.v1.AutoMlClient)3 ModelEvaluation (com.google.cloud.automl.v1.ModelEvaluation)3 ListModelEvaluationsPagedResponse (com.google.cloud.aiplatform.v1.ModelServiceClient.ListModelEvaluationsPagedResponse)2 ListModelEvaluationsRequest (com.google.cloud.automl.v1.ListModelEvaluationsRequest)2 ModelName (com.google.cloud.automl.v1.ModelName)2 AutoMlClient (com.google.cloud.automl.v1beta1.AutoMlClient)2 ModelEvaluation (com.google.cloud.automl.v1beta1.ModelEvaluation)2 AbstractMessage (com.google.protobuf.AbstractMessage)2 Test (org.junit.Test)2 ModelEvaluationName (com.google.cloud.automl.v1.ModelEvaluationName)1 ListModelEvaluationsRequest (com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest)1 ModelEvaluationName (com.google.cloud.automl.v1beta1.ModelEvaluationName)1 ModelName (com.google.cloud.automl.v1beta1.ModelName)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1 Before (org.junit.Before)1