The V4 version of the Watson Machine Learning REST API and Watson Machine Learning Python client library have some significant differences from the v3 version and from the V4 beta version. The V4 library supports a range of new functionality, including deployment spaces and software specifications.
Watson Machine Learning REST API now includes a VersionDate parameter that you can use to associate your model, script, or function code with a particular version of the API. This can help you avoid needing to update your code if a new
feature is introduced in a later version. For details, see the REST API documentation.
These changes might require that you modify your code to execute successfully on the new release.
See Using Watson Machine Learning in a notebook for links to sample notebooks that demonstrate this new functionality.
/ml/v4/models/`{model_id}`/content
/ml/v4/functions/`{function_id}`/code
guid will no longer be supported in metadata; use id instead.role field is removed from the metadata for all assets.import field will be removed from the model and pipeline payload. For models, use content_location to import the model from training output.commit_message.space and project object in the POST payload will be replaced by space_id and project_id.tags field supports an array of string.content_status and content_formats field will be removed from the model. Use content_import_state field/ml/v4/models/{model_id}/content./ml/v4/models/{model_id}/content/{attachment_id} and download by search: /ml/v4/models/{model_id}/download./ml/v4/functions/{function_id}/code`` and/ml/v4/functions/{function_id}/code`.The following APIs support new features in Watson Machine Learning:
For details, see Watson Machine Learning REST API.
The following fields were deprecated in IBM Cloud Pak for Data 3.0.1. Support has now been discontinued.
| Field name or technique | Usage | Replace with |
|---|---|---|
href |
referencing a Watson Machine Learning resource in a request payload | id |
assets array |
querying a space | assets API |
project and space resoure references |
request payloads | project_id and space_id string fields |
name, description, space_id, tags |
response body | moved to metadata tags are now an array of strings |
parent |
metadata | parent_id string field |
training_lib |
in Models resource | model_definition |
training_lib |
in Experiments resource ( training_references[].training_lib) |
model_definition |
training_lib_href |
in Pipelines resource ( document.pipelines[].nodes[].parameters.training_lib_href) |
model_definition |
href |
reference a deployment in jobs_entity_request |
id |
Get all spaces using /v4/spaces |
load all assets for each space | use specific APIs for getting assets |
Note these changes from the beta version of the V4 Python client to the generally available version.
| Description | Beta python client package usage | New python client package usage |
|---|---|---|
| Package to install | !pip install watson-machine-learning-client-V4 |
!pip install ibm-watson-machine-learning |
| Import statement | from watson_machine_learning_client import WatsonMachineLearningAPIClient |
'from ibm_watson_machine_learning import APIClient` |
| Client instance creation statement | client = WatsonMachineLearningAPIClient(wml_credentials) |
client = APIClient(wml_credentials) |
| Package versions | Package version 1.0.99 or higher (Latest version is 1.0.115) | Use version 1.0.9 or higher |
| Documentation | https://wml-api-pyclient-dev-v4.mybluemix.net/ | http://ibm-wml-api-pyclient.mybluemix.net |