-
Notifications
You must be signed in to change notification settings - Fork 8
UseCase 2 Pseudocode
Step 1: Login to framework with user’s credentials (username: guest, password: 4j5ySRwv):
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Cache-Control: no-cache" -d 'username=guest&password=4j5ySRwv' http://app.jaqpot.org:8080/jaqpot/services/aa/login
Result: A token is being generated for this particular user. We will use this token as a header for subsequent calls.
e.g.
Step 2: Select a dataset
GET a list of available datasets (subjectid is our token):
curl -X GET -H "Accept: application/json" -H "subjectid: AQIC5wM2LY4SfcyHcdErm7xjM3TxP0vHxIZzjTrGGwffk8s.*AAJTSQACMDEAAlNLABI5ODAxMzg1MjQ5MzQ3NzcyNjA.*" -H "Cache-Control: no-cache" http://app.jaqpot.org:8080/jaqpot/services/dataset/featured?max=10
Result: an array of metadata for (public) datasets.
e.g.
Step 3: GET more information for a dataset
The user can either access the entirety of the dataset
curl -X GET -H "subjectid: AQIC5wM2LY4SfcwSYQ2Pv9bfcvYjKsp91cxj7R5a5OAhEC0.*AAJTSQACMDEAAlNLABMtNDA2NzI0NjM3ODYzNTkwMjUx*" -H "Accept: application/json" -H "Cache-Control: no-cache" http://app.jaqpot.org:8080/jaqpot/services/dataset/WWfBO1cSzOdKSN
or only information about residing features:
curl -X GET -H "subjectid: AQIC5wM2LY4SfcwSYQ2Pv9bfcvYjKsp91cxj7R5a5OAhEC0.*AAJTSQACMDEAAlNLABMtNDA2NzI0NjM3ODYzNTkwMjUx*" -H "Accept: application/json" -H "Cache-Control: no-cache" http://app.jaqpot.org:8080/jaqpot/services/dataset/WWfBO1cSzOdKSN/features
Step 4: GET available algorithms:
curl -X GET -H "Accept: application/json" -H "subjectid: AQIC5wM2LY4SfcyHcdErm7xjM3TxP0vHxIZzjTrGGwffk8s.*AAJTSQACMDEAAlNLABI5ODAxMzg1MjQ5MzQ3NzcyNjA.*" -H "Cache-Control: no-cache" http://app.jaqpot.org:8080/jaqpot/services/algorithm?max=10
Result: an array of algorithms (trainingService is the URI endpoint for the given algorithm’s training service. predictionService is the URI endpoint that with the help of a model created by the training service, can generate predictions on another dataset).
e.g.
Step 4: Create a prediction model with the help of a dataset, a model and parameters.
Initiate the training service by providing a title and a description for the new model, a datasetURI, a prediction feature URI and an algorithm URI:
curl -X POST -H "subjectid: AQIC5wM2LY4SfcytYPj_7-vimnp0ijCFwvvHTK6OJOpczGQ.*AAJTSQACMDEAAlNLABMxOTkwNTMyNTA0NTM5NTkyNTI0*" -H "Origin: http://app.jaqpot.org:8080" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Cache-Control: no-cache" -d 'title=My model&description=My model&dataset_uri=http://app.jaqpot.org:8080/jaqpot/services/dataset/WWfBO1cSzOdKSN&prediction_feature=https://apps.ideaconsult.net/ambit2/feature/22200¶meters={"alpha":1}' http://app.jaqpot.org:8080/jaqpot/services/algorithm/python-lasso
Result: a task entity that informs about the progress of training process.
e.g.
With subsequent GET calls on the task URI we are informed about the status of training service.
curl -X GET -H "subjectid: AQIC5wM2LY4SfcytYPj_7-vimnp0ijCFwvvHTK6OJOpczGQ.*AAJTSQACMDEAAlNLABMxOTkwNTMyNTA0NTM5NTkyNTI0*" -H "Accept: application/json" http://app.jaqpot.org:8080/jaqpot/services/task/9HseWRnBpJSi
Result: When the task is completed the response JSON looks like this:
Model URI can be found under “resultURI”. Comments and percentageCompleted can be used to update a related UI.
Step 5: Using the model to get predictions.
Initiate a prediction service by providing a model URI and a dataset URI.
curl -X POST -H "subjectid: AQIC5wM2LY4SfcwuN_HKop6k0aDiS2ckjNx6Op6MJt4f4WI.*AAJTSQACMDEAAlNLABM2ODgyNTA5NTg3NTQwNTk0NzA1*" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Cache-Control: no-cache" -d 'dataset_uri=http://app.jaqpot.org:8080/jaqpot/services/dataset/WWfBO1cSzOdKSN' http://app.jaqpot.org:8080/jaqpot/services/model/vrN9hHo3oBiNLu1Nfz0I
Result: a task entity that informs about the progress of prediction process.
e.g.
With subsequent GET calls on the task URI we are informed about the status of training service.
curl -X GET -H "subjectid: AQIC5wM2LY4SfcytYPj_7-vimnp0ijCFwvvHTK6OJOpczGQ.*AAJTSQACMDEAAlNLABMxOTkwNTMyNTA0NTM5NTkyNTI0*" -H "Accept: application/json" http://app.jaqpot.org:8080/jaqpot/services/task/TSKP0r5E0ww0vz3
Result: When the task is completed the response JSON looks like this:
Dataset URI can be found under “resultURI”.