|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hive.service.AbstractService
org.apache.hive.service.CompositeService
org.apache.lens.server.ml.MLServiceImpl
public class MLServiceImpl
The Class MLServiceImpl.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hive.service.CompositeService |
|---|
org.apache.hive.service.CompositeService.CompositeServiceShutdownHook |
| Nested classes/interfaces inherited from interface org.apache.hive.service.Service |
|---|
org.apache.hive.service.Service.STATE |
| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
The Constant LOG. |
| Fields inherited from interface org.apache.lens.ml.LensML |
|---|
NAME |
| Constructor Summary | |
|---|---|
MLServiceImpl()
Instantiates a new ML service impl. |
|
MLServiceImpl(String name)
Instantiates a new ML service impl. |
|
| Method Summary | |
|---|---|
void |
clearModels()
Clear models. |
void |
deleteModel(String algorithm,
String modelID)
Permanently delete a model instance. |
void |
deleteTestReport(String algorithm,
String reportID)
Permanently delete a test report instance. |
MLAlgo |
getAlgoForName(String algorithm)
Get a algo object instance which could be used to generate a model of the given algorithm. |
Map<String,String> |
getAlgoParamDescription(String algorithm)
Get user friendly information about parameters accepted by the algorithm. |
List<String> |
getAlgorithms()
Get list of available machine learning algorithms |
MLModel |
getModel(String algorithm,
String modelId)
Get a model instance given the algorithm name and model ID. |
String |
getModelPath(String algorithm,
String modelID)
Get the FS location where model instance is saved. |
List<String> |
getModels(String algorithm)
Get model IDs for the given algorithm. |
MLTestReport |
getTestReport(String algorithm,
String reportID)
Get a test report by ID. |
List<String> |
getTestReports(String algorithm)
Get test reports for an algorithm. |
void |
init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
|
Object |
predict(String algorithm,
String modelID,
Object[] features)
Online predict call given a model ID, algorithm name and sample feature values. |
void |
start()
|
void |
stop()
|
MLTestReport |
testModel(LensSessionHandle sessionHandle,
String table,
String algorithm,
String modelID,
String outputTable)
Evaluate model by running it against test data contained in the given table. |
String |
train(String table,
String algorithm,
String[] args)
Create a model using the given HCatalog table as input. |
| Methods inherited from class org.apache.hive.service.CompositeService |
|---|
getServices |
| Methods inherited from class org.apache.hive.service.AbstractService |
|---|
getHiveConf, getName, getServiceState, getStartTime, register, unregister |
| 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
| Constructor Detail |
|---|
public MLServiceImpl()
public MLServiceImpl(String name)
name - the name| Method Detail |
|---|
public List<String> getAlgorithms()
LensML
getAlgorithms in interface LensML
public MLAlgo getAlgoForName(String algorithm)
throws LensException
LensML
getAlgoForName in interface LensMLalgorithm - the algorithm
LensException - the lens exception
public String train(String table,
String algorithm,
String[] args)
throws LensException
LensML
train in interface LensMLtable - the tablealgorithm - the algorithmargs - the args
LensException - the lens exception
public List<String> getModels(String algorithm)
throws LensException
LensML
getModels in interface LensMLalgorithm - the algorithm
LensException - the lens exception
public MLModel getModel(String algorithm,
String modelId)
throws LensException
LensML
getModel in interface LensMLalgorithm - the algorithmmodelId - the model id
LensException - the lens exceptionpublic void init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
init in interface org.apache.hive.service.Serviceinit in class org.apache.hive.service.CompositeServicepublic void start()
start in interface org.apache.hive.service.Servicestart in class org.apache.hive.service.CompositeServicepublic void stop()
stop in interface org.apache.hive.service.Servicestop in class org.apache.hive.service.CompositeServicepublic void clearModels()
public String getModelPath(String algorithm,
String modelID)
LensML
getModelPath in interface LensMLalgorithm - the algorithmmodelID - the model id
public MLTestReport testModel(LensSessionHandle sessionHandle,
String table,
String algorithm,
String modelID,
String outputTable)
throws LensException
LensML
testModel in interface LensMLsessionHandle - the sessiontable - the tablealgorithm - the algorithmmodelID - the model id
LensException - the lens exception
public List<String> getTestReports(String algorithm)
throws LensException
LensML
getTestReports in interface LensMLalgorithm - the algorithm
LensException - the lens exception
public MLTestReport getTestReport(String algorithm,
String reportID)
throws LensException
LensML
getTestReport in interface LensMLalgorithm - the algorithmreportID - the report id
LensException - the lens exception
public Object predict(String algorithm,
String modelID,
Object[] features)
throws LensException
LensML
predict in interface LensMLalgorithm - the algorithmmodelID - the model idfeatures - the features
LensException - the lens exception
public void deleteModel(String algorithm,
String modelID)
throws LensException
LensML
deleteModel in interface LensMLalgorithm - the algorithmmodelID - the model id
LensException - the lens exception
public void deleteTestReport(String algorithm,
String reportID)
throws LensException
LensML
deleteTestReport in interface LensMLalgorithm - the algorithmreportID - the report id
LensException - the lens exceptionpublic Map<String,String> getAlgoParamDescription(String algorithm)
LensML
getAlgoParamDescription in interface LensMLalgorithm - the algorithm
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||