public class ModelApiV11 extends MLRestAPI
Constructor and Description |
---|
ModelApiV11() |
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(long modelId,
String mode)
Download the model
|
javax.ws.rs.core.Response |
getAllModels()
Get all models
|
javax.ws.rs.core.Response |
getModel(String modelName)
Get the model data
|
javax.ws.rs.core.Response |
getModelSummary(long modelId)
Get the model summary
|
javax.ws.rs.core.Response |
getProductRecommendations(long modelId,
int userId,
int noOfProducts)
Get a list of recommended products for a given user using the given model.
|
javax.ws.rs.core.Response |
getUserRecommendations(long modelId,
int productId,
int noOfUsers)
Get a list of recommended users for a given product using the given model.
|
javax.ws.rs.core.Response |
options() |
javax.ws.rs.core.Response |
predict(long modelId,
List<String[]> data,
double percentile,
boolean skipDecoding)
Make predictions using a model
|
javax.ws.rs.core.Response |
predict(long modelId,
String dataFormat,
InputStream inputStream,
double percentile,
boolean skipDecoding)
Predict using a file and return as a list of predicted values.
|
javax.ws.rs.core.Response |
publishModel(long modelId,
String mode)
Publish the model to ML registry
|
javax.ws.rs.core.Response |
streamingPredict(long modelId,
String dataFormat,
String columnHeader,
InputStream inputStream,
double percentile,
boolean skipDecoding)
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, String mode)
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, double percentile, boolean skipDecoding)
modelId
- Unique id of the modeldataFormat
- Data format of the file (CSV or TSV)inputStream
- File input stream generated from the file used for predictionspercentile
- a threshold value used to identified cluster boundariesskipDecoding
- whether the decoding should not be done (true or false)public javax.ws.rs.core.Response streamingPredict(long modelId, String dataFormat, String columnHeader, InputStream inputStream, double percentile, boolean skipDecoding)
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 predictionspercentile
- a threshold value used to identified cluster boundariesskipDecoding
- whether the decoding should not be done (true or false)StreamingOutput
public javax.ws.rs.core.Response predict(long modelId, List<String[]> data, double percentile, boolean skipDecoding)
modelId
- Unique id of the modeldata
- List of string arrays containing the feature values used for predictionspercentile
- a threshold value used to identified cluster boundariesskipDecoding
- whether the decoding should not be done (true or false)public javax.ws.rs.core.Response getModel(String modelName)
modelName
- Name of the modelMLModelData
objectpublic 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(long modelId, String mode)
modelId
- Name of the modelMLModel
as a StreamingOutput
public javax.ws.rs.core.Response getProductRecommendations(long modelId, int userId, int noOfProducts)
modelId
- id of the recommendation model to be used.userId
- id of the user.noOfProducts
- number of recommendations required.public javax.ws.rs.core.Response getUserRecommendations(long modelId, int productId, int noOfUsers)
modelId
- id of the recommendation model to be used.productId
- id of the product.noOfUsers
- number of recommendations required.Copyright © 2015 WSO2, Inc.. All Rights Reserved.