

We are no longer updating the Amazon Machine Learning service or accepting new users for it. This documentation is available for existing users, but we are no longer updating it. For more information, see [ What is Amazon Machine Learning](https://docs.aws.amazon.com/machine-learning/latest/dg/what-is-amazon-machine-learning.html).

# Generating and Interpreting Predictions
<a name="interpreting_predictions"></a>

Amazon ML provides two mechanisms for generating predictions: asynchronous (batch-based) and synchronous (one-at-a-time).

Use asynchronous predictions, or *batch predictions***,** when you have a number of observations and would like to obtain predictions for the observations all at once. The process uses a datasource as input, and outputs predictions into a .csv file stored in an S3 bucket of your choice. You need to wait until the batch prediction process completes before you can access the prediction results. The maximum size of a datasource that Amazon ML can process in a batch file is 1 TB (approximately 100 million records). If your datasource is larger than 1 TB, your job will fail and Amazon ML will return an error code. To prevent this, divide your data into multiple batches. If your records are typically longer, you will reach the 1 TB limit before 100 million records are processed. In this case, we recommend that you contact [AWS support](https://aws.amazon.com/contact-us/) to increase the job size for your batch prediction.

Use synchronous, or *real-time predictions***,** when you want to obtain predictions at low latency. The real-time prediction API accepts a single input observation serialized as a JSON string, and synchronously returns the prediction and associated metadata as part of the API response. You can simultaneously invoke the API more than once to obtain synchronous predictions in parallel. For more information about throughput limits of the real-time prediction API, see real-time prediction limits in [Amazon ML API reference](http://docs.aws.amazon.com/machine-learning/latest/APIReference/).

**Topics**
+ [

# Creating a Batch Prediction
](creating-batch-prediction-objects.md)
+ [

# Reviewing Batch Prediction Metrics
](working-with-batch-predictions.md)
+ [

# Reading the Batch Prediction Output Files
](reading-the-batchprediction-output-files.md)
+ [

# Requesting Real-time Predictions
](requesting-real-time-predictions.md)

# Creating a Batch Prediction
<a name="creating-batch-prediction-objects"></a>

To create a batch prediction, you create a `BatchPrediction` object using either the Amazon Machine Learning (Amazon ML) console or API. A `BatchPrediction` object describes a set of predictions that Amazon ML generates by using your ML model and a set of input observations. When you create a `BatchPrediction` object, Amazon ML starts an asynchronous workflow that computes the predictions. 

You must use the same schema for the datasource that you use to obtain batch predictions and the datasource that you used to train the ML model that you query for predictions. The one exception is that the datasource for a batch prediction doesn't need to include the target attribute because Amazon ML predicts the target. If you provide the target attribute, Amazon ML ignores its value. 

## Creating a Batch Prediction (Console)
<a name="batch-prediction-console"></a>

To create a batch prediction using the Amazon ML console, use the Create Batch Prediction wizard. 

**To create a batch prediction (console)**

1. Sign in to the AWS Management Console and open the Amazon Machine Learning console at [https://console.aws.amazon.com/machinelearning/](https://console.aws.amazon.com/machinelearning/).

1. On the Amazon ML dashboard, under **Objects**, choose **Create new...**, and then choose **Batch prediction**.

1. Choose the Amazon ML model that you want to use to create the batch prediction.

1. To confirm that you want to use this model, choose **Continue**.

1. Choose the datasource that you want to create predictions for. The datasource must have the same schema as your model, although it doesn't need to include the target attribute.

1. Choose **Continue**.

1. For **S3 destination**, type the name of your S3 bucket.

1. Choose **Review**.

1. Review your settings and choose **Create batch prediction**.

## Creating a Batch Prediction (API)
<a name="batch-prediction-api"></a>

To create a `BatchPrediction` object using the Amazon ML API, you must provide the following parameters:

**Datasource ID**  
The ID of the datasource that points to the observations for which you want predictions. For example, if you want predictions for data in a file called `s3://examplebucket/input.csv`, you would create a datasource object that points to the data file, and then pass in the ID of that datasource with this parameter.

**BatchPrediction ID**  
The ID to assign to the batch prediction.

**ML Model ID**  
The ID of the ML model that Amazon ML should query for the predictions.

**Output Uri**  
The URI of the S3 bucket in which to store the output of the prediction. Amazon ML must have permissions to write data to this bucket.  
The `OutputUri` parameter must refer to an S3 path that ends with a forward slash ('/') character, as shown in the following example:  
s3://examplebucket/examplepath/  
For information about configuring S3 permissions , see [Granting Amazon ML Permissions to Output Predictions to Amazon S3](granting-amazon-ml-permissions-to-output-predictions-to-amazon-s3.md).

**(Optional) BatchPrediction Name**  
(Optional) A human-readable name for your batch prediction.

# Reviewing Batch Prediction Metrics
<a name="working-with-batch-predictions"></a>

After Amazon Machine Learning (Amazon ML) creates a batch prediction, it provides two metrics: `Records seen` and `Records failed to process`. `Records seen` tells you how many records Amazon ML looked at when it ran your batch prediction. `Records failed to process` tells you how many records Amazon ML could not process.

To allow Amazon ML to process failed records, check the formatting of the records in the data used to create your datasource, and make sure that all of the required attributes are present and all of the data is correct. After fixing your data, you can either recreate your batch prediction, or create a new datasource with the failed records, and then create a new batch prediction using the new datasource.

## Reviewing Batch Prediction Metrics (Console)
<a name="review-console"></a>

To see the metrics in the Amazon ML console, open the **Batch prediction summary** page and look in the **Processed Info** section.

## Reviewing Batch Prediction Metrics and Details (API)
<a name="review-api"></a>

You can use the Amazon ML APIs to retrieve details about `BatchPrediction` objects, including the record metrics. Amazon ML provides the following batch prediction API calls:
+ `CreateBatchPrediction`
+ `UpdateBatchPrediction`
+ `DeleteBatchPrediction`
+ `GetBatchPrediction`
+ `DescribeBatchPredictions`

For more information, see the [Amazon ML API Reference](https://docs.aws.amazon.com/machine-learning/latest/APIReference/).

# Reading the Batch Prediction Output Files
<a name="reading-the-batchprediction-output-files"></a>

Perform the following steps to retrieve the batch prediction output files:

1. Locate the batch prediction manifest file.

1. Read the manifest file to determine the locations of output files.

1. Retrieve the output files that contain the predictions.

1. Interpret the contents of the output files. Contents will vary based on the type of ML model that was used to generate predictions.

The following sections describe the steps in greater detail.

## Locating the Batch Prediction Manifest File
<a name="locating-the-batch-prediction-manifest-file"></a>

The manifest files of the batch prediction contain the information that maps your input files to the prediction output files.

To locate the manifest file, start with the output location that you specified when you created the batch prediction object. You can query a completed batch prediction object to retrieve the S3 location of this file by using either the [Amazon ML API](https://docs.aws.amazon.com/machine-learning/latest/APIReference/) or the [https://console.aws.amazon.com/machinelearning/](https://console.aws.amazon.com/machinelearning/).

The manifest file is located in the output location in a path that consists of the static string `/batch-prediction/` appended to the output location and the name of the manifest file, which is the ID of the batch prediction, with the extension `.manifest` appended to that.

For example, if you create a batch prediction object with the ID `bp-example`, and you specify the S3 location `s3://examplebucket/output/` as the output location, you will find your manifest file here:

`s3://examplebucket/output/batch-prediction/bp-example.manifest`

## Reading the Manifest File
<a name="reading-the-manifest-file"></a>

The contents of the .manifest file are encoded as a JSON map, where the key is a string of the name of an S3 input data file, and the value is a string of the associated batch prediction result file. There is one mapping line for each input/output file pair. Continuing with our example, if the input for the creation of the `BatchPrediction` object consists of a single file called data.csv that is located in `s3://examplebucket/input/`, you might see a mapping string that looks like this:

```
{"s3://examplebucket/input/data.csv":"
s3://examplebucket/output/batch-prediction/result/bp-example-data.csv.gz"}
```

If the input to the creation of the `BatchPrediction` object consists of three files called data1.csv, data2.csv, and data3.csv, and they are all stored in the S3 location `s3://examplebucket/input/`, you might see a mapping string that looks like this:

```
{"s3://examplebucket/input/data1.csv":"s3://examplebucket/output/batch-prediction/result/bp-example-data1.csv.gz",

"s3://examplebucket/input/data2.csv":"
s3://examplebucket/output/batch-prediction/result/bp-example-data2.csv.gz",

"s3://examplebucket/input/data3.csv":"
s3://examplebucket/output/batch-prediction/result/bp-example-data3.csv.gz"}
```

## Retrieving the Batch Prediction Output Files
<a name="retrieving-the-batch-prediction-output-files"></a>

You can download each batch prediction file obtained from the manifest mapping and process it locally. The file format is CSV, compressed with the gzip algorithm. Within that file, there is one line per input observation in the corresponding input file.

To join the predictions with the input file of the batch prediction, you can perform a simple record-by-record merge of the two files. The output file of the batch prediction always contains the same number of records as the prediction input file, in the same order. If an input observation fails in processing, and no prediction can be generated, the output file of the batch prediction will have a blank line in the corresponding location.

## Interpreting the Contents of Batch Prediction Files for a Binary Classification ML model
<a name="interpreting-the-contents-of-batch-prediction-files-for-a-binary-classification-ml-model"></a>

The columns of the batch prediction file for a binary classification model are named **bestAnswer** and **score**.

The **bestAnswer** column contains the prediction label ("1" or "0") that is obtained by evaluating the prediction score against the cut-off score. For more information about cut-off scores, see [Adjusting the Score Cut-off](https://docs.aws.amazon.com/machine-learning/latest/dg/evaluating_models.html). You set a cut-off score for the ML model by using either the Amazon ML API or the model evaluation functionality on the Amazon ML console. If you don't set a cut-off score,Amazon ML uses the default value of 0.5.

The **score** column contains the raw prediction score assigned by the ML model for this prediction. Amazon ML uses logistic regression models, so this score attempts to model the probability of the observation that corresponds to a true ("1") value. Note that the **score** is reported in scientific notation, so in the first row of the following example, the value 8.7642E-3 is equal to 0.0087642.

For example, if the cut-off score for the ML model is 0.75, the contents of the batch prediction output file for a binary classification model might look like this:

```
bestAnswer,score

0,8.7642E-3

1,7.899012E-1


0,6.323061E-3

0,2.143189E-2


1,8.944209E-1
```

The second and fifth observations in the input file have received prediction scores above 0.75, so the bestAnswer column for these observations indicates value "1", while other observations have the value "0".

## Interpreting the Contents of Batch Prediction Files for a Multiclass Classification ML Model
<a name="interpreting-the-contents-of-batch-prediction-files-for-a-multiclass-classification-ml-model"></a>

The batch prediction file for a multiclass model contains one column for each class found in the training data. Column names appear in the header line of the batch prediction file.

When you request predictions from a multiclass model, Amazon ML computes several prediction scores for each observation in the input file, one for each of the classes defined in the input dataset. It is equivalent to asking "What is the probability (measured between 0 and 1) that this observation will fall into this class, as opposed to any of the other classes?" Each score can be interpreted as a "probability that the observation belongs to this class." Because prediction scores model the underlying probabilities of the observation belonging to one class or another, the sum of all the prediction scores across a row is 1. You need to pick one class as the predicted class for the model. Most commonly, you would pick the class that has the highest probability as the best answer.

For example, consider attempting to predict a customer's rating of a product, based on a 1-to-5 star scale. If the classes are named `1_star`, `2_stars`, `3_stars`, `4_stars`, and `5_stars`, the multiclass prediction output file might look like this:

```
1_star, 2_stars, 3_stars, 4_stars, 5_stars

8.7642E-3, 2.7195E-1, 4.77781E-1, 1.75411E-1, 6.6094E-2

5.59931E-1, 3.10E-4, 2.48E-4, 1.99871E-1, 2.39640E-1

7.19022E-1, 7.366E-3, 1.95411E-1, 8.78E-4, 7.7323E-2

1.89813E-1, 2.18956E-1, 2.48910E-1, 2.26103E-1, 1.16218E-1

3.129E-3, 8.944209E-1, 3.902E-3, 7.2191E-2, 2.6357E-2
```

In this example, the first observation has the highest prediction score for the `3_stars` class (prediction score = 4.77781E-1), so you would interpret the results as showing that class `3_stars` is the best answer for this observation. Note that prediction scores are reported in scientific notation, so a prediction score of 4.77781E-1 is equal to 0.477781.

There may be circumstances when you do not want to choose the class with the highest probability. For example, you might want to establish a minimum threshold below which you won't consider a class as the best answer even if it has the highest prediction score. Suppose you are classifying movies into genres, and you want the prediction score to be at least 5E-1 before you declare the genre to be your best answer. You get a prediction score of 3E-1 for comedies, 2.5E-1 for dramas, 2.5E-1 for documentaries, and 2E-1 for action movies. In this case, the ML model predicts that comedy is your most likely choice, but you decide not to choose it as the best answer. Because none of the prediction scores exceeded your baseline prediction score of 5E-1, you decide that the prediction is insufficient to confidently predict the genre and you decide to choose something else. Your application might then treat the genre field for this movie as "unknown."

## Interpreting the Contents of Batch Prediction Files for a Regression ML Model
<a name="interpreting-the-contents-of-batch-prediction-files-for-a-regression-ml-model"></a>

The batch prediction file for a regression model contains a single column named **score**. This column contains the raw numeric prediction for each observation in the input data. The values are reported in scientific notation, so the **score** value of -1.526385E1 is equal to -15.26835 in the first row in the following example. 

This example shows an output file for a batch prediction performed on a regression model:

```
score

-1.526385E1

-6.188034E0

-1.271108E1

-2.200578E1

8.359159E0
```

# Requesting Real-time Predictions
<a name="requesting-real-time-predictions"></a>

A real-time prediction is a synchronous call to Amazon Machine Learning (Amazon ML). The prediction is made when Amazon ML gets the request, and the response is returned immediately. Real-time predictions are commonly used to enable predictive capabilities within interactive web, mobile, or desktop applications. You can query an ML model created with Amazon ML for predictions in real time by using the low-latency `Predict` API. The `Predict` operation accepts a single input observation in the request payload, and returns the prediction synchronously in the response. This sets it apart from the batch prediction API, which is invoked with the ID of an Amazon ML datasource object that points to the location of the input observations, and asynchronously returns a URI to a file that contains predictions for all these observations. Amazon ML responds to most real-time prediction requests within 100 milliseconds.

You can try real-time predictions without incurring charges in the Amazon ML console. If you then decide to use real-time predictions, you must first create an endpoint for real-time prediction generation. You can do this in the Amazon ML console or by using the `CreateRealtimeEndpoint` API. After you have an endpoint, use the real-time prediction API to generate real-time predictions.

**Note**  
After you create a real-time endpoint for your model, you will start incurring a capacity reservation charge that is based on the model's size. For more information, see [Pricing](http://aws.amazon.commachine-learning/pricing/). If you create the real-time endpoint in the console, the console displays a breakdown of the estimated charges that the endpoint will accrue on an ongoing basis. To stop incurring the charge when you no longer need to obtain real-time predictions from that model, remove the real-time endpoint by using the console or the `DeleteRealtimeEndpoint` operation.

For examples of `Predict` requests and responses, see [Predict](https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_Predict.html) in the *Amazon Machine Learning API Reference*. To see an example of the exact response format that uses your model, see [Trying Real-Time Predictions](#testing-real-time-predictions).

**Topics**
+ [

## Trying Real-Time Predictions
](#testing-real-time-predictions)
+ [

## Creating a Real-Time Endpoint
](#creating-a-real-time-endpoint)
+ [

## Locating the Real-time Prediction Endpoint (Console)
](#locate-endpoint-by-console)
+ [

## Locating the Real-time Prediction Endpoint (API)
](#locating-the-real-time-prediction-endpoint)
+ [

## Creating a Real-time Prediction Request
](#real-time-prediction-request-format)
+ [

## Deleting a Real-Time Endpoint
](#delete-endpoint)

## Trying Real-Time Predictions
<a name="testing-real-time-predictions"></a>

To help you decide whether to enable real-time prediction, Amazon ML allows you to try generating predictions on single data records without incurring the additional charges associated with setting up a real-time prediction endpoint. To try real-time prediction, you must have an ML model. To create real-time predictions on a larger scale, use the [Predict](https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_Predict.html) API in the *Amazon Machine Learning API Reference*.

**To try real-time predictions**

1. Sign in to the AWS Management Console and open the Amazon Machine Learning console at [https://console.aws.amazon.com/machinelearning/](https://console.aws.amazon.com/machinelearning/).

1. In the navigation bar, in the **Amazon Machine Learning** drop down, choose **ML models**.

1. Choose the model that you want to use to try real-time predictions, such as the `Subscription propensity model` from the tutorial.

1. On the ML model report page, under **Predictions**, choose **Summary**, and then choose **Try real-time predictions**.  
![\[Tools section with option to try real-time predictions.\]](http://docs.aws.amazon.com/machine-learning/latest/dg/images/try-real-time.png)

   Amazon ML shows a list of the variables that made up the data records that Amazon ML used to train your model.

1. You can proceed by entering data in each of the fields in the form or by pasting a single data record, in CSV format, into the text box.

   To use the form, for each **Value** field, enter the data that you want to use to test your real-time predictions. If the data record you are entering does not contain values for one or more data attributes, leave the entry fields blank.

   To provide a data record, choose **Paste a record**. Paste a single CSV-formatted row of data into the text field, and choose **Submit**. Amazon ML auto-populates the **Value** fields for you.
**Note**  
The data in the data record must have the same number of columns as the training data, and be arranged in the same order. The only exception is that you should omit the target value. If you include a target value, Amazon ML ignores it.

1. At the bottom of the page, choose **Create prediction**. Amazon ML returns the prediction immediately.

   In the **Prediction results** pane, you see the prediction object that the `Predict` API call returns, along with the ML model type, the name of the target variable, and the predicted class or value. For information about interpreting the results, see [Interpreting the Contents of Batch Prediction Files for a Binary Classification ML model](reading-the-batchprediction-output-files.md#interpreting-the-contents-of-batch-prediction-files-for-a-binary-classification-ml-model).  
![\[Prediction results showing binary ML model type with predicted label 0 and score details.\]](http://docs.aws.amazon.com/machine-learning/latest/dg/images/real-time-result.png)

## Creating a Real-Time Endpoint
<a name="creating-a-real-time-endpoint"></a>

To generate real-time predictions, you need to create a real-time endpoint. To create a real-time endpoint, you must already have an ML model for which you want to generate real-time predictions. You can create a real-time endpoint by using the Amazon ML console or by calling the `CreateRealtimeEndpoint` API. For more information on using the `CreateRealtimeEndpoint` API, see [https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_CreateRealtimeEndpoint.html](https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_CreateRealtimeEndpoint.html) in the Amazon Machine Learning API Reference.

**To create a real-time endpoint**

1. Sign in to the AWS Management Console and open the Amazon Machine Learning console at [https://console.aws.amazon.com/machinelearning/](https://console.aws.amazon.com/machinelearning/).

1. In the navigation bar, in the **Amazon Machine Learning** drop down, choose **ML models**.

1. Choose the model for which you want to generate real-time predictions.

1. On the **ML model summary** page, under **Predictions**, choose **Create real-time endpoint**.

   A dialog box that explains how real-time predictions are priced appears.

1. Choose **Create**. The real-time endpoint request is sent to Amazon ML and entered into a queue. The status of the real-time endpoint is **Updating**.  
![\[Real-time endpoint status shown as "Updating" in a user interface element.\]](http://docs.aws.amazon.com/machine-learning/latest/dg/images/endpoint-updating.png)

1. When the real-time endpoint is ready, the status changes to **Ready**, and Amazon ML displays the endpoint URL. Use the endpoint URL to create real-time prediction requests with the `Predict` API. For more information about using the `Predict` API, see [https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_Predict.html](https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_Predict.html) in the Amazon Machine Learning API Reference.  
![\[Real-time endpoint status showing Ready with an endpoint URL and Peak Requests Per Second value.\]](http://docs.aws.amazon.com/machine-learning/latest/dg/images/endpoint-ready.png)

## Locating the Real-time Prediction Endpoint (Console)
<a name="locate-endpoint-by-console"></a>

To use the Amazon ML console to find the endpoint URL for an ML model navigate to the model's **ML model summary** page.

**To locate a real-time endpoint URL**

1. Sign in to the AWS Management Console and open the Amazon Machine Learning console at [https://console.aws.amazon.com/machinelearning/](https://console.aws.amazon.com/machinelearning/).

1. In the navigation bar, in the **Amazon Machine Learning** drop down, choose **ML models**.

1. Choose the model for which you want to generate real-time predictions.

1. On the **ML model summary** page, scroll down until you see the **Predictions** section.

1. The endpoint URL for the model is listed in **Real-time prediction**. Use the URL as the **Endpoint Url** URL for your real-time prediction calls. For information on how to use the endpoint to generate predictions, see [https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_Predict.html](https://docs.aws.amazon.com/machine-learning/latest/APIReference/API_Predict.html) in the Amazon Machine Learning API Reference.

## Locating the Real-time Prediction Endpoint (API)
<a name="locating-the-real-time-prediction-endpoint"></a>

When you create a real-time endpoint by using the `CreateRealtimeEndpoint` operation, the URL and status of the endpoint is returned to you in the response. If you created the real-time endpoint by using the console or if you want to retrieve the URL and status of an endpoint that you created earlier, call the `GetMLModel` operation with the ID of the model that you want to query for real-time predictions. The endpoint information is contained in the `EndpointInfo` section of the response. For a model that has a real-time endpoint associated with it, the `EndpointInfo` might look like this:

```
"EndpointInfo":{
    "CreatedAt": 1427864874.227,
    "EndpointStatus": "READY",
    "EndpointUrl": "https://endpointUrl",
    "PeakRequestsPerSecond": 200
}
```

A model without a real-time endpoint would return the following:

```
EndpointInfo":{
    "EndpointStatus": "NONE",
    "PeakRequestsPerSecond": 0
}
```

## Creating a Real-time Prediction Request
<a name="real-time-prediction-request-format"></a>

A sample `Predict` request payload might look like this:

```
{
    "MLModelId": "model-id",
    "Record":{
        "key1": "value1",
        "key2": "value2"
    },
    "PredictEndpoint": "https://endpointUrl"
}
```

The `PredictEndpoint` field must correspond to the `EndpointUrl` field of the `EndpointInfo` structure. Amazon ML uses this field to route the request to the appropriate servers in the real-time prediction fleet.

The `MLModelId` is the identifier of a previously trained model with a real-time endpoint.

A `Record` is a map of variable names to variable values. Each pair represents an observation. The `Record` map contains the inputs to your Amazon ML model. It is analogous to a single row of data in your training data set, without the target variable. Regardless of the type of values in the training data, `Record` contains a string-to-string mapping.

**Note**  
You can omit variables for which you do not have a value, although this might reduce the accuracy of your prediction. The more variables you can include, the more accurate your model is.

The format of the response returned by `Predict` requests depends on the type of model that is being queried for prediction. In all cases, the `details` field contains information about the prediction request, notably including the `PredictiveModelType` field with the model type.

The following example shows a response for a binary model:

```
{
    "Prediction":{
        "details":{
            "PredictiveModelType": "BINARY"
        },
        "predictedLabel": "0",
        "predictedScores":{
            "0": 0.47380468249320984
        }
    }
}
```

Notice the `predictedLabel` field that contains the predicted label, in this case 0. Amazon ML computes the predicted label by comparing the prediction score against the classification cut-off:
+ You can obtain the classification cut-off that is currently associated with an ML model by inspecting the `ScoreThreshold` field in the response of the `GetMLModel` operation, or by viewing the model information in the Amazon ML console. If you do not set a score threshold, Amazon ML uses the default value of 0.5.
+ You can obtain the exact prediction score for a binary classification model by inspecting the `predictedScores` map. Within this map, the predicted label is paired with the exact prediction score.

For more information about binary predictions, see [Interpreting the Predictions](binary-model-insights.md#interpreting-the-predictions).

The following example shows a response for a regression model. Notice that the predicted numeric value is found in the `predictedValue` field:

```
{
    "Prediction":{
        "details":{
            "PredictiveModelType": "REGRESSION"
        },
        "predictedValue": 15.508452415466309
    }
}
```

The following example shows a response for a multiclass model: 

```
{
    "Prediction":{
        "details":{
            "PredictiveModelType": "MULTICLASS"
        },
        "predictedLabel": "red",
        "predictedScores":{
            "red": 0.12923571467399597,
            "green": 0.08416014909744263,
            "orange": 0.22713537514209747,
            "blue": 0.1438363939523697,
            "pink": 0.184102863073349,
            "violet": 0.12816807627677917,
            "brown": 0.10336143523454666
        }
    }
}
```

Similar to binary classification models, the predicted label/class is found in the `predictedLabel` field. You can further understand how strongly the prediction is related to each class by looking at the `predictedScores` map. The higher the score of a class within this map, the more strongly the prediction is related to the class, with the highest value ultimately being selected as the `predictedLabel`.

For more information about multiclass predictions, see [Multiclass Model Insights](multiclass-model-insights.md).

## Deleting a Real-Time Endpoint
<a name="delete-endpoint"></a>

When you've completed your real-time predictions, delete the real-time endpoint to avoid incurring additional charges. Charges stop accruing as soon as you delete your endpoint.

**To delete a real-time endpoint**

1. Sign in to the AWS Management Console and open the Amazon Machine Learning console at [https://console.aws.amazon.com/machinelearning/](https://console.aws.amazon.com/machinelearning/).

1. In the navigation bar, in the **Amazon Machine Learning** drop down, choose **ML models**.

1. Choose the model that no longer requires real-time predictions.

1. On the ML model report page, under **Predictions**, choose **Summary**. 

1. Choose **Delete real-time endpoint**.

1. In the **Delete real-time endpoint** dialog box, choose **Delete**.