Requirements for using custom components in your models
You can define your own transformers, estimators, functions, classes, and tensor operations in models you deploy in IBM Watson Machine Learning as online deployments. This topic lists requirements for using custom components in your models.
Learning from a sample
You can view or download a sample notebook that demontrates using custom components.
Defining and using custom components
To use custom components in your models, you need to package your custom components in a Python distribution package .
See: Packaging Python Projects
Package requirements
-
The package type must be: source distribution
(distributions of type Wheel and Egg are not supported)
-
The package file format must be:
.zip
-
Any third-party dependencies for your custom components must be installable by
pip
and must be passed to theinstall_requires
argument of thesetup
function of thesetuptools
library
See: Creating a source distribution
Storing your custom package
You must take extra steps when storing your trained model in the Watson Machine Learning repository:
- Store your custom package in the Watson Machine Learning repository (using the
runtimes.store_library
function from the Watson Machine Learning Python client, or the
store libraries
Watson Machine Learning CLI command.) - Create a runtime resource object that references your stored custom package, and then store the runtime resource object in the Watson Machine Learning repository (using the
runtimes.store
function, or the
store runtimes
command.) - When you store your trained model in the Watson Machine Learning repository, reference your stored runtime resource in meta data passed to the
store_model
function (or the
store
command.)
Examples
Required Watson Machine Learning interface versions
-
Command Line Interface (CLI) : 2.1.0
-
Watson Machine Learning Python client
: 1.0.293
Supported frameworks
For support details, listed by framework, see: Supported frameworks