public class ModelApiV10 extends MLRestAPI
Constructor and Description |
---|
ModelApiV10() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addStorage(long modelId,
org.wso2.carbon.ml.commons.domain.MLStorage storage)
Create a new model storage
|
javax.ws.rs.core.Response |
buildModel(long modelId)
Build the model
|
javax.ws.rs.core.Response |
createModel(org.wso2.carbon.ml.commons.domain.MLModelData model)
Create a new Model.
|
javax.ws.rs.core.Response |
deleteModel(long modelId)
Delete a model
|
javax.ws.rs.core.Response |
exportModel(String modelName)
Download the model
|
javax.ws.rs.core.Response |
getAllModels()
Get all models
|
javax.ws.rs.core.Response |
getModel(String modelName) |
javax.ws.rs.core.Response |
getModelSummary(long modelId)
Get the model summary
|
javax.ws.rs.core.Response |
getRecommendations(long modelId,
int userId,
int noOfProducts)
Get the model data
|
javax.ws.rs.core.Response |
options() |
javax.ws.rs.core.Response |
predict(long modelId,
List<String[]> data)
Make predictions using a model
|
javax.ws.rs.core.Response |
predict(long modelId,
String dataFormat,
InputStream inputStream)
Predict using a file and return as a list of predicted values.
|
javax.ws.rs.core.Response |
publishModel(long modelId)
Publish the model to ML registry
|
javax.ws.rs.core.Response |
streamingPredict(long modelId,
String dataFormat,
String columnHeader,
InputStream inputStream)
Predict using a file and return predictions as a CSV.
|
getTenantID
public javax.ws.rs.core.Response options()
public javax.ws.rs.core.Response createModel(org.wso2.carbon.ml.commons.domain.MLModelData model)
model
- MLModelData
objectMLModelData
objectpublic javax.ws.rs.core.Response addStorage(long modelId, org.wso2.carbon.ml.commons.domain.MLStorage storage)
modelId
- Unique id of the modelstorage
- MLStorage
objectpublic javax.ws.rs.core.Response buildModel(long modelId)
modelId
- Unique id of the model to be built.public javax.ws.rs.core.Response publishModel(long modelId)
modelId
- Unique id of the model to be publishedMLResponseBean
containing the published location of the modelpublic javax.ws.rs.core.Response predict(long modelId, String dataFormat, InputStream inputStream)
modelId
- Unique id of the modeldataFormat
- Data format of the file (CSV or TSV)inputStream
- File input stream generated from the file used for predictionspublic javax.ws.rs.core.Response streamingPredict(long modelId, String dataFormat, String columnHeader, InputStream inputStream)
modelId
- Unique id of the modeldataFormat
- Data format of the file (CSV or TSV)columnHeader
- Whether the file contains the column header as the first row (YES or NO)inputStream
- Input stream generated from the file used for predictionsStreamingOutput
public javax.ws.rs.core.Response predict(long modelId, List<String[]> data)
modelId
- Unique id of the modeldata
- List of string arrays containing the feature values used for predictionspublic javax.ws.rs.core.Response getRecommendations(long modelId, int userId, int noOfProducts)
modelName
- Name of the modelMLModelData
objectpublic javax.ws.rs.core.Response getModel(String modelName)
public javax.ws.rs.core.Response getAllModels()
MLModelData
objectspublic javax.ws.rs.core.Response deleteModel(long modelId)
modelId
- Unique id of the modelpublic javax.ws.rs.core.Response getModelSummary(long modelId)
modelId
- Unique id of the modelModelSummary
objectpublic javax.ws.rs.core.Response exportModel(String modelName)
modelName
- Name of the modelMLModel
as a StreamingOutput
Copyright © 2015 WSO2, Inc.. All Rights Reserved.