public abstract class BaseSparkAlgo extends Object implements MLAlgo
Constructor and Description |
---|
BaseSparkAlgo(String name,
String description)
Instantiates a new base spark algo.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(LensConf configuration)
Configure.
|
Map<String,String> |
getArgUsage() |
LensConf |
getConf() |
String |
getDescription() |
String |
getName() |
double |
getParamValue(String param,
double defaultVal)
Gets the param value.
|
int |
getParamValue(String param,
int defaultVal)
Gets the param value.
|
abstract void |
parseAlgoParams(Map<String,String> params)
Parses the algo params.
|
void |
parseParams(String[] args)
Parses the params.
|
void |
setSparkContext(org.apache.spark.api.java.JavaSparkContext sparkContext) |
MLModel<?> |
train(LensConf conf,
String db,
String table,
String modelId,
String... params)
Train.
|
public void setSparkContext(org.apache.spark.api.java.JavaSparkContext sparkContext)
public void configure(LensConf configuration)
MLAlgo
public MLModel<?> train(LensConf conf, String db, String table, String modelId, String... params) throws LensException
MLAlgo
train
in interface MLAlgo
conf
- the confdb
- the dbtable
- the tablemodelId
- the model idparams
- the paramsLensException
- the lens exceptionpublic void parseParams(String[] args)
args
- the argspublic double getParamValue(String param, double defaultVal)
param
- the paramdefaultVal
- the default valpublic int getParamValue(String param, int defaultVal)
param
- the paramdefaultVal
- the default valpublic String getDescription()
getDescription
in interface MLAlgo
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.