@Singleton @Path(value="/mostSurprising") public final class MostSurprising extends AbstractOryxResource
Responds to a GET request to /mostSurprising/[userID](?howMany=n)(?offset=o)
.
This is like an anti-recommend
method, where the results are taken from among
the items that the user has already interacted with, and the results are items that
seem least-likely to be interacted with according to the model.
Outputs contain item and score pairs, where the score is an opaque
value where higher values mean more surprising.
If the user is not known to the model, a
Response.Status.NOT_FOUND
response is generated.
If the user has no known items associated, the response has no elements.
howMany
and offset
behavior, and output, are as in Recommend
.
INPUT_PRODUCER_KEY, MODEL_MANAGER_KEY
Constructor and Description |
---|
MostSurprising() |
Modifier and Type | Method and Description |
---|---|
List<IDValue> |
get(String userID,
int howMany,
int offset) |
check, check, checkExists, checkNotReadOnly, getServingModel, isReadOnly, maybeBuffer, maybeBuffer, maybeDecompress, parseMultipart, sendInput
getInputProducer, getServingModelManager, init
@GET @Path(value="{userID}") @Produces(value={"text/plain","text/csv","application/json"}) public List<IDValue> get(@PathParam(value="userID") String userID, @DefaultValue(value="10") @QueryParam(value="howMany") int howMany, @DefaultValue(value="0") @QueryParam(value="offset") int offset) throws OryxServingException
OryxServingException
Copyright © 2014–2018. All rights reserved.