public class MLServiceResource extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ML_UP_MESSAGE
Message indicating if ML service is up
|
Constructor and Description |
---|
MLServiceResource()
Instantiates a new ML service resource.
|
Modifier and Type | Method and Description |
---|---|
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
|
public static final String ML_UP_MESSAGE
public MLServiceResource()
public String mlResourceUp()
public StringList getAlgoNames()
public StringList getParamDescription(String algorithm)
algorithm
- the algorithmpublic StringList getModelsForAlgo(String algorithm) throws LensException
algorithm
- algorithm nameLensException
- the lens exceptionpublic ModelMetadata getModelMetadata(String algorithm, String modelID) throws LensException
algorithm
- algorithm namemodelID
- model IDLensException
- the lens exceptionpublic String deleteModel(String algorithm, String modelID) throws LensException
algorithm
- the algorithmmodelID
- the model idLensException
- the lens exceptionpublic String train(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 dataLensException
- the lens exceptionpublic javax.ws.rs.core.Response clearModelCache()
public String test(String algorithm, String modelID, 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 queryLensException
- the lens exceptionpublic StringList getReportsForAlgorithm(String algoritm) throws LensException
algoritm
- the algoritmLensException
- the lens exceptionpublic TestReport getTestReport(String algorithm, String reportID) throws LensException
algorithm
- the algorithmreportID
- the report idLensException
- the lens exceptionpublic String deleteTestReport(String algorithm, String reportID) throws LensException
algorithm
- the algorithmreportID
- the report idLensException
- the lens exceptionpublic String predict(String algorithm, String modelID, @Context javax.ws.rs.core.UriInfo uriInfo) throws LensException
algorithm
- the algorithmmodelID
- the model iduriInfo
- the uri infoLensException
- the lens exceptionCopyright © 2014–2015 Apache Software Foundation. All rights reserved.