@Singleton @Path(value="/predict") public final class Predict extends AbstractOryxResource
Responds to a GET request to /predict/[datum]
, or a POST to /predict
containing several data points, one on each line. The inputs are data points to predict,
delimited, like "1,foo,3.0". The value of the target feature in the input is ignored.
The response body contains the result of prediction, one for each input data point, one per line. The result depends on the classifier or regressor -- could be a number or a category name. If JSON output is selected, the result is a JSON list.
INPUT_PRODUCER_KEY, MODEL_MANAGER_KEY
Constructor and Description |
---|
Predict() |
Modifier and Type | Method and Description |
---|---|
String |
get(String datum) |
List<String> |
post(javax.servlet.http.HttpServletRequest request) |
List<String> |
post(Reader reader) |
check, check, checkExists, checkNotReadOnly, getServingModel, isReadOnly, maybeBuffer, maybeBuffer, maybeDecompress, parseMultipart, sendInput
getInputProducer, getServingModelManager, init
@GET @Path(value="{datum}") @Produces(value={"text/plain","text/csv","application/json"}) public String get(@PathParam(value="datum") String datum) throws OryxServingException
OryxServingException
@POST @Consumes(value={"text/plain","text/csv","application/json"}) @Produces(value={"text/plain","text/csv","application/json"}) public List<String> post(Reader reader) throws IOException, OryxServingException
IOException
OryxServingException
@POST @Consumes(value="multipart/form-data") @Produces(value={"text/plain","text/csv","application/json"}) public List<String> post(@Context javax.servlet.http.HttpServletRequest request) throws IOException, OryxServingException
IOException
OryxServingException
Copyright © 2014–2018. All rights reserved.