| Constructor and Description | 
|---|
| LensMLImpl(org.apache.hadoop.hive.conf.HiveConf conf)Instantiates a new lens ml impl. | 
| Modifier and Type | Method and Description | 
|---|---|
| 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 | 
| org.apache.hadoop.hive.conf.HiveConf | getConf() | 
| org.apache.hadoop.hive.conf.HiveConf | getHiveConf() | 
| 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)Inits the. | 
| Object | predict(String algorithm,
       String modelID,
       Object[] features)Online predict call given a model ID, algorithm name and sample feature values. | 
| void | setSparkContext(org.apache.spark.api.java.JavaSparkContext jsc)Use an existing Spark context. | 
| void | start()Start. | 
| void | stop()Stop. | 
| MLTestReport | testModel(LensSessionHandle sessionHandle,
         String table,
         String algorithm,
         String modelID,
         QueryRunner queryRunner,
         String outputTable)Evaluate a model. | 
| MLTestReport | testModel(LensSessionHandle session,
         String table,
         String algorithm,
         String modelID,
         String outputTable)Evaluate model by running it against test data contained in the given table. | 
| MLTestReport | testModelRemote(LensSessionHandle sessionHandle,
               String table,
               String algorithm,
               String modelID,
               String queryApiUrl,
               String outputTable)Test a model in embedded mode. | 
| String | train(String table,
     String algorithm,
     String[] args)Create a model using the given HCatalog table as input. | 
public LensMLImpl(org.apache.hadoop.hive.conf.HiveConf conf)
conf - the confpublic org.apache.hadoop.hive.conf.HiveConf getConf()
public void setSparkContext(org.apache.spark.api.java.JavaSparkContext jsc)
jsc - JavaSparkContext instancepublic List<String> getAlgorithms()
LensMLgetAlgorithms in interface LensMLpublic MLAlgo getAlgoForName(String algorithm) throws LensException
LensMLgetAlgoForName in interface LensMLalgorithm - the algorithmLensException - the lens exceptionpublic String train(String table, String algorithm, String[] args) throws LensException
LensMLtrain in interface LensMLtable - the tablealgorithm - the algorithmargs - the argsLensException - the lens exceptionpublic List<String> getModels(String algorithm) throws LensException
LensMLgetModels in interface LensMLalgorithm - the algorithmLensException - the lens exceptionpublic MLModel getModel(String algorithm, String modelId) throws LensException
LensMLgetModel in interface LensMLalgorithm - the algorithmmodelId - the model idLensException - the lens exceptionpublic void init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
hiveConf - the hive confpublic void start()
public void stop()
public org.apache.hadoop.hive.conf.HiveConf getHiveConf()
public void clearModels()
public String getModelPath(String algorithm, String modelID)
LensMLgetModelPath in interface LensMLalgorithm - the algorithmmodelID - the model idpublic MLTestReport testModel(LensSessionHandle session, String table, String algorithm, String modelID, String outputTable) throws LensException
LensMLtestModel in interface LensMLsession - the sessiontable - the tablealgorithm - the algorithmmodelID - the model idLensException - the lens exceptionpublic MLTestReport testModelRemote(LensSessionHandle sessionHandle, String table, String algorithm, String modelID, String queryApiUrl, String outputTable) throws LensException
sessionHandle - the session handletable - the tablealgorithm - the algorithmmodelID - the model idqueryApiUrl - the query api urlLensException - the lens exceptionpublic MLTestReport testModel(LensSessionHandle sessionHandle, String table, String algorithm, String modelID, QueryRunner queryRunner, String outputTable) throws LensException
This call also required a query runner. Query runner is responsible for executing the evaluation query against Lens server.
sessionHandle - the session handletable - the tablealgorithm - the algorithmmodelID - the model idqueryRunner - the query runneroutputTable - table where test output will be writtenLensException - the lens exceptionpublic List<String> getTestReports(String algorithm) throws LensException
LensMLgetTestReports in interface LensMLalgorithm - the algorithmLensException - the lens exceptionpublic MLTestReport getTestReport(String algorithm, String reportID) throws LensException
LensMLgetTestReport in interface LensMLalgorithm - the algorithmreportID - the report idLensException - the lens exceptionpublic Object predict(String algorithm, String modelID, Object[] features) throws LensException
LensMLpredict in interface LensMLalgorithm - the algorithmmodelID - the model idfeatures - the featuresLensException - the lens exceptionpublic void deleteModel(String algorithm, String modelID) throws LensException
LensMLdeleteModel in interface LensMLalgorithm - the algorithmmodelID - the model idLensException - the lens exceptionpublic void deleteTestReport(String algorithm, String reportID) throws LensException
LensMLdeleteTestReport in interface LensMLalgorithm - the algorithmreportID - the report idLensException - the lens exceptionpublic Map<String,String> getAlgoParamDescription(String algorithm)
LensMLgetAlgoParamDescription in interface LensMLalgorithm - the algorithmCopyright © 2014–2015 Apache Software Foundation. All rights reserved.