Work with Oracle Machine Learning Models
Oracle Machine Learning Services is a middle tier web application that uses an Oracle Database as the backend repository. Oracle Machine Learning Services supports model deployment of Oracle Machine Learning models and ONNX format models. Model deployment refers to the method for integrating machine learning models into the production environment.
Supported Functions
- Storing, deleting, and listing of deployed models
- Retrieving metadata and content of models
- Organizing models under namespace
- Creating, deleting, and listing of model endpoints
- Getting Swagger document for the model endpoint
- Getting model details
- Getting endpoint details
- Scoring with model endpoints
Supported Machine Learning Models
- Classification models
- Clustering models
- Feature Extraction models
- Regression models
Note:
Partitioned models are also included.Note:
Models with embedded sql transformations are not supported.Deployment methods
- Deploy an In-database Model from Your Database to Oracle Machine Learning Services
- You can also depoy models from Oracle Machine Learning Models UI. See Deploy a Model from OML Models UI for more information.
- Deploy an In-database Model to Oracle Machine Learning Services Via File Export
cURL Commands
- View the Oracle Machine Learning Services REST API
- Get the List of Saved Models
- View a Specific Model by Referencing the Model ID
- Get a List of Models Filtered by Model Name
- Get a List of Models Filtered by Version and Namespace
1: View the Oracle Machine Learning Services REST API
This example demonstrates how to view the OML Services REST API.
curl -i -X GET --header "Authorization: Bearer ${token}" "<oml-cloud-service-location-url>/omlmod/v1/api"
HTTP/1.1 200 OK Date: Tue, 10 Nov 2021 18:03:08 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, DELETE, PUT Access-Control-Allow-Headers: X-Requested-With, Content-Type { "openapi": "3.0.0", "info": { "title": "OML Services APIs", "description": "APIs for the Oracle Machine Learning Services.", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "Simeon Greene", "url": "http://www.oracle.com", "email": "simeon.m.greene@oracle.com" }, "version": "1.0.0" }, "servers": .. ..
2: Get the List of Saved Models
This example demonstrates how to get the list of all OML models that are saved in the repository.
curl -X GET --header "Authorization: Bearer ${token}" "<oml-cloud-service-location-url>/omlmod/v1/models" | jq
{ "items": [ { "version": "1.5", "modelType": "OML", "createdBy": "OMLUSER", "modelId": "1b6fed66-bacb-48c7-8549-14542abe2a82", "modelName": "OML_Insurance_Affinity", "links": [ { "rel": "self", "href": "https://qtraya2braestch-omldb.adb.us-sanjose-1.oraclecloudapps.com/omlmod/v1/models/1b6fed66-bacb-48c7-8549-14542abe2a82" } ], "namespace": "OML_MODELS", "shared": true, "storedOn": "2021-11-16T20:43:28.733Z" }, { "version": "1.4", "modelType": "ONNX", "createdBy": "OMLUSER", "modelId": "228707fa-218a-4fb9-b1e7-bc111059a04f", "modelName": "onnxTitanicModel", "links": [ { "rel": "self", "href": "https://qtraya2braestch-omldb.adb.us-sanjose-1.oraclecloudapps.com/omlmod/v1/models/228707fa-218a-4fb9-b1e7-bc111059a04f" } ], "namespace": "ONNX_MODELS", "shared": true, "storedOn": "2021-11-16T21:07:13.291Z" }, ... ... } ] }
3: View a Specific Model by Referencing the Model ID
Note:
To view a model by referencing the model ID, you must first export themodel_Id
.
$model_Id
:
export model_Id=bc5cf626-d4f6-45ba-8a50-c3e57a008bd7
In this example, bc5cf626-d4f6-45ba-8a50-c3e57a008bd7
is the
model_Id
.
model_Id
:curl -X GET --header "Authorization: Bearer ${token}" "<oml-cloud-service-location-url>/omlmod/v1/models/$model_Id" | jq
bc5cf626-d4f6-45ba-8a50-c3e57a008bd7
:
{ "version": "1.0", "modelType": "OML", "createdBy": "OMLUSER", "modelId": "bc5cf626-d4f6-45ba-8a50-c3e57a008bd7", "modelName": "GLM_MODEL", "links": [ { "rel": "self", "href": "https://qtraya2braestch-omldb.adb.us-sanjose-1.oraclecloudapps.com/omlmod/v1/models/bc5cf626-d4f6-45ba-8a50-c3e57a008bd7" } ], "namespace": "OML_MODELS", "shared": true, "storedOn": "2021-11-06T22:16:29.387Z" }
4: Get a List of Models Filtered by Model Name
This example demonstrates how to get a list of models filtered by model name.
modelName
.
In this example, the modelName
is
GLM_MODEL
.
curl -X GET --header "Authorization: Bearer $token" "<oml-cloud-service-location-url>/omlmod/v1/models?modelName=GLM_MODEL" | jq
{ "items": [ { "version": "1.5", "modelType": "OML", "createdBy": "OMLUSER", "modelId": "bc5cf626-d4f6-45ba-8a50-c3e57a008bd7", "modelName": "GLM_Model", "links": [ { "rel": "self", "href": "https://qtraya2braestch-omldb.adb.us-sanjose-1.oraclecloudapps.com/omlmod/v1/models/1b6fed66-bacb-48c7-8549-14542abe2a82" } ], "namespace": "OML_MODELS", "shared": true, "storedOn": "2021-11-16T20:43:28.733Z" }, } ] }
5: Get a List of Models Filtered by Version and Namespace
This example demonstrates how to get a list of models filtered by version and namespace of a model.
version=1.0
and namespace=OML_MODELS
:curl -X GET --header "Authorization: Bearer $token" "<oml-cloud-service-location-url>/omlmod/v1/models?version=1.0&namespace=OML_MODELS" | jq
{ "items": [ { "version": "1.0", "modelType": "OML", "createdBy": "OMLUSER", "modelId": "bc5cf626-d4f6-45ba-8a50-c3e57a008bd7", "modelName": "GLM_MODEL", "links": [ { "rel": "self", "href": "https://qtraya2braestch-omldb.adb.us-sanjose-1.oraclecloudapps.com/omlmod/v1/models/bc5cf626-d4f6-45ba-8a50-c3e57a008bd7" } ], "namespace": "OML_MODELS", "shared": true, "storedOn": "2021-11-06T22:16:29.387Z" } ], "links": [ { "rel": "self", "href": "https://qtraya2braestch-omldb.adb.us-sanjose-1.oraclecloudapps.com/omlmod/v1/models" } ] }