|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lens.server.ml.MLServiceResource
@Path(value="/ml")
@Produces(value={"application/json","application/xml"})
public class MLServiceResourceMachine Learning service.
| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
The Constant LOG. |
static String |
ML_UP_MESSAGE
Message indicating if ML service is up |
| Constructor Summary | |
|---|---|
MLServiceResource()
Instantiates a new ML service resource. |
|
| Method Summary | |
|---|---|
javax.ws.rs.core.Response |
clearModelCache()
Clear model cache (for admin use). |
String |
deleteModel(String algorithm,
String modelID)
Delete a model given model ID and algorithm name. |
String |
deleteTestReport(String algorithm,
String reportID)
DELETE a report given the algorithm name and report ID. |
StringList |
getAlgoNames()
Get a list of algos available |
ModelMetadata |
getModelMetadata(String algorithm,
String modelID)
Get metadata of the model given algorithm and model ID. |
StringList |
getModelsForAlgo(String algorithm)
Get model ID list for a given algorithm. |
StringList |
getParamDescription(String algorithm)
Gets the human readable param description of an algorithm |
StringList |
getReportsForAlgorithm(String algoritm)
Get list of reports for a given algorithm. |
TestReport |
getTestReport(String algorithm,
String reportID)
Get a single test report given the algorithm name and report id. |
String |
mlResourceUp()
Indicates if ML resource is up |
String |
predict(String algorithm,
String modelID,
javax.ws.rs.core.UriInfo uriInfo)
Predict. |
String |
test(String algorithm,
String modelID,
String table,
LensSessionHandle session,
String outputTable)
Run a test on a model for an algorithm. |
String |
train(String algorithm,
javax.ws.rs.core.MultivaluedMap<String,String> form)
Train a model given an algorithm name and algorithm parameters |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
public static final String ML_UP_MESSAGE
| Constructor Detail |
|---|
public MLServiceResource()
| Method Detail |
|---|
@GET public String mlResourceUp()
@GET @Path(value="algos") public StringList getAlgoNames()
@GET
@Path(value="algos/{algorithm}")
public StringList getParamDescription(@PathParam(value="algorithm")
String algorithm)
algorithm - the algorithm
@GET
@Path(value="models/{algorithm}")
public StringList getModelsForAlgo(@PathParam(value="algorithm")
String algorithm)
throws LensException
algorithm - algorithm name
LensException - the lens exception
@GET
@Path(value="models/{algorithm}/{modelID}")
public ModelMetadata getModelMetadata(@PathParam(value="algorithm")
String algorithm,
@PathParam(value="modelID")
String modelID)
throws LensException
algorithm - algorithm namemodelID - model ID
LensException - the lens exception
@DELETE
@Consumes(value={"application/json","application/xml","text/plain"})
@Path(value="models/{algorithm}/{modelID}")
public String deleteModel(@PathParam(value="algorithm")
String algorithm,
@PathParam(value="modelID")
String modelID)
throws LensException
algorithm - the algorithmmodelID - the model id
LensException - the lens exception
@POST
@Consumes(value="application/x-www-form-urlencoded")
@Path(value="{algorithm}/train")
public String train(@PathParam(value="algorithm")
String algorithm,
javax.ws.rs.core.MultivaluedMap<String,String> form)
throws LensException
Following parameters are mandatory and must be passed as part of the form
algorithm - algorithm nameform - form data
LensException - the lens exception@DELETE @Path(value="clearModelCache") @Produces(value="text/plain") public javax.ws.rs.core.Response clearModelCache()
@POST
@Path(value="test/{table}/{algorithm}/{modelID}")
@Consumes(value="multipart/form-data")
public String test(@PathParam(value="algorithm")
String algorithm,
@PathParam(value="modelID")
String modelID,
@PathParam(value="table")
String table,
LensSessionHandle session,
String outputTable)
throws LensException
algorithm - algorithm namemodelID - model IDtable - Hive table to run test onsession - Lens session ID. This session ID will be used to run the test query
LensException - the lens exception
@GET
@Path(value="reports/{algorithm}")
public StringList getReportsForAlgorithm(@PathParam(value="algorithm")
String algoritm)
throws LensException
algoritm - the algoritm
LensException - the lens exception
@GET
@Path(value="reports/{algorithm}/{reportID}")
public TestReport getTestReport(@PathParam(value="algorithm")
String algorithm,
@PathParam(value="reportID")
String reportID)
throws LensException
algorithm - the algorithmreportID - the report id
LensException - the lens exception
@DELETE
@Path(value="reports/{algorithm}/{reportID}")
@Consumes(value={"application/json","application/xml","text/plain"})
public String deleteTestReport(@PathParam(value="algorithm")
String algorithm,
@PathParam(value="reportID")
String reportID)
throws LensException
algorithm - the algorithmreportID - the report id
LensException - the lens exception
@GET
@Path(value="/predict/{algorithm}/{modelID}")
@Produces(value={"application/atom+xml","application/json"})
public String predict(@PathParam(value="algorithm")
String algorithm,
@PathParam(value="modelID")
String modelID,
@Context
javax.ws.rs.core.UriInfo uriInfo)
throws LensException
algorithm - the algorithmmodelID - the model iduriInfo - the uri info
LensException - the lens exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||