0 / 0
Decision Optimization Python client examples

Python client examples

You can deploy a Decision Optimization model, create and monitor jobs, and get solutions by using the Watson Machine Learning Python client.

To deploy your model, see Model deployment.

For more information, see Watson Machine Learning Python client documentation.

The Python notebook Deploying a Decision Optimization model in Watson Machine Learning, available from the Cloud Pak for Data Resource hub, illustrates how you can perform the following tasks:
  • Install the Watson Machine Learning client API.
  • Create a client instance.
  • Prepare your model archive.
  • Upload your model on Watson Machine Learning.
  • Create a deployment.
  • Create and monitor a job with inline data for your deployed model.
  • Display the solution.
See also the following sample notebooks located in the jupyter folder of the DO-samples. Select the relevant product and version subfolder..
  • Deploying a DO model with WML
  • RunDeployedModel
  • ExtendWMLSoftwareSpec

The Deploying a DO model with WML sample shows you how to deploy a Decision Optimization model, create and monitor jobs, and get solutions by using the Watson Machine Learning Python client. This notebook uses the diet sample for the Decision Optimization model and takes you through the whole procedure without using the Decision Optimization experiment UI.

The RunDeployedModel shows you how to run jobs and get solutions from an existing deployed model. This notebook uses a model that is saved for deployment from a Decision Optimization experiment UI scenario.

The ExtendWMLSoftwareSpecnotebook shows you how to extend the Decision Optimization software specification within Watson Machine Learning. By extending the software specification, you can use your own pip package to add custom code and deploy it in your model and send jobs to it.

You can also find in the samples several notebooks for deploying various models, for example CPLEX, DOcplex and OPL models with different types of data.

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more