Evaluation models

This section describes how to evaluate a trained models in AI & Analytics Engine.

For those that are trained successfully, you can access the results of evaluation by the following

from aiaengine import Model

model = Model(id='c8dbd4fd-4a33-4923-ab17-75e0a5139eb7')
# evaluate the model using the latest test portion of the input dataset
evaluation = model.evaluate()

# if you have an existing dataset that you want to use for evaluating your model
# you can use the following code
# evaluation = model.evaluate(test_dataset_id='ID_of_dataset')

print("Evaluation summary")
print(evaluation.result.summary)
print("Evaluation metrics")
print(evaluation.result.details['threshold_independent']['metrics'])
package com.aiaengine.examples.model;

import com.aiaengine.Engine;
import com.aiaengine.Evaluation;
import com.aiaengine.Model;
import com.aiaengine.model.request.EvaluationRequest;

import java.io.FileNotFoundException;
import java.util.Map;

public class EvaluateModelApp {
    public static void main(String[] args) throws FileNotFoundException {
        Engine engine = new Engine();
        //replace with your model id
        Model model = engine.getModel("9310c78a-3970-457f-afea-6e2e2545eb7b");
        Evaluation evaluation = model.evaluate(EvaluationRequest.builder().build());
        System.out.println(String.format("Evaluation summary: %s", evaluation.getResult().getSummary()));
        System.out.println(String.format("Evaluation metrics: %s", ((Map<String, Object>) evaluation.getResult().getDetails().get("threshold_independent")).get("metrics")));

    }
}