public class ModelHandler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FILE_STORAGE_PREFIX |
static String |
PATH_TO_GOVERNANCE_REGISTRY |
static String |
REGISTRY_STORAGE_PREFIX |
Constructor and Description |
---|
ModelHandler(String modelStorageLocation) |
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithmClass()
Returns the algorithm class - classification, numerical prediction or clustering
|
Map<String,Integer> |
getFeatures()
Return the map containing <feature-name, index> pairs
|
org.wso2.carbon.ml.commons.domain.MLModel |
getMlModel() |
List<Integer> |
getNewToOldIndicesList()
Get new to old indices list of this model.
|
String |
getResponseVariable()
Return the response variable of the model
|
Object |
predict(String[] data,
String outputType)
Predict the value using the feature values.
|
Object |
predict(String[] data,
String outputType,
double percentile)
Predict the value using the feature values.
|
Object |
predict(String[] data,
String outputType,
org.wso2.carbon.ml.core.h2o.POJOPredictor pojoPredictor)
Predict the value using the feature values with POJO predictor.
|
public static final String FILE_STORAGE_PREFIX
public static final String REGISTRY_STORAGE_PREFIX
public static final String PATH_TO_GOVERNANCE_REGISTRY
public ModelHandler(String modelStorageLocation) throws ClassNotFoundException, URISyntaxException, org.wso2.carbon.ml.core.exceptions.MLInputAdapterException, IOException
modelStorageLocation
- MLModel storage locationClassNotFoundException
- class not found exceptionURISyntaxException
- URI syntax exceptionorg.wso2.carbon.ml.core.exceptions.MLInputAdapterException
- ML input adapter exceptionIOException
- java IO exceptionpublic Object predict(String[] data, String outputType) throws org.wso2.carbon.ml.core.exceptions.MLModelHandlerException
data
- feature values arrayoutputType
- data type of the outputorg.wso2.carbon.ml.core.exceptions.MLModelHandlerException
- throws ML model handler exceptionpublic Object predict(String[] data, String outputType, double percentile) throws org.wso2.carbon.ml.core.exceptions.MLModelHandlerException
data
- feature values arrayoutputType
- output typepercentile
- percentile value for predictionsorg.wso2.carbon.ml.core.exceptions.MLModelHandlerException
- throws ML model handler exceptionpublic Object predict(String[] data, String outputType, org.wso2.carbon.ml.core.h2o.POJOPredictor pojoPredictor) throws org.wso2.carbon.ml.core.exceptions.MLModelHandlerException
data
- feature values arrayoutputType
- data type of the outputpojoPredictor
- POJO predictororg.wso2.carbon.ml.core.exceptions.MLModelHandlerException
- ML model handler exceptionpublic Map<String,Integer> getFeatures()
public List<Integer> getNewToOldIndicesList()
public String getResponseVariable()
public String getAlgorithmClass()
public org.wso2.carbon.ml.commons.domain.MLModel getMlModel()
Copyright © 2017 WSO2. All rights reserved.