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

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

Introduction

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

Prototype


public void setRecord(java.util.Map<String, String> record) 

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.
 *//* w w w . j  a v  a2  s.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;
}