Example usage for com.amazonaws.services.machinelearning.model PredictRequest PredictRequest

List of usage examples for com.amazonaws.services.machinelearning.model PredictRequest PredictRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.machinelearning.model PredictRequest PredictRequest.

Prototype

PredictRequest

Source Link

Usage

From source file:AndroidRealtimePrediction.java

License:Open Source License

/**
 * Once the real-time endpoint is acquired, we can start calling predict for our model
 * Pass in a Map with attribute=value pairs.  Render numbers as strings.
 *///from  ww w.j  a v  a  2s.c o  m
public PredictResult predict(Map<String, String> record) {
    PredictRequest request = new PredictRequest();
    request.setMLModelId(mlModelId);
    request.setPredictEndpoint(endpoint);

    // Populate record with data relevant to the ML model
    request.setRecord(record);
    PredictResult result = client.predict(request);

    return result;
}