ClusteringSolution - Global
-
- UpdatedJan 30, 2025
- 10 minutes to read
- Yokohama
- API reference
The ClusteringSolution API is a scriptable object used in Predictive Intelligence stores.
This API requires the Predictive Intelligence plugin (com.glide.platform_ml) and is provided
within the sn_ml
namespace.
- Create a dataset using the DatasetDefinition API.
- Mandatory if using the K-means clustering algorithm. Build an encoder using the Encoder API.
- Use the constructor to create a clustering solution object.
- Add the solution object to the clustering solution store using the ClusteringSolutionStore - add() method.
- Train the solution using the submitTrainingJob() method. This creates a version of the object that you can manage using the ClusteringSolutionVersion API.
- Get predictions using the ClusteringSolutionVersion – predict() method.
For usage guidelines, refer to Using ML APIs.
ClusteringSolution - ClusteringSolution(Object config)
Creates a cluster solution.
Example
The following example shows how to create an object and add it to the ClusteringSolution store. The example also shows how to submit the object for training.
Output:
Example
The following example shows how to include the 'description' field as a cluster concept field.
ClusteringSolution - cancelTrainingJob()
Cancels a job for a solution object that has been submitted for training.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
None |
Example
The following example shows how to cancel an existing training job.
ClusteringSolution - getActiveVersion()
Gets the active ClusteringSolutionVersion object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | Active ClusteringSolutionVersion object. |
Example
The following example shows how to get an active ClusteringSolution version from the store and return its training status.
Output:
ClusteringSolution - getAllVersions()
Gets all versions of a clustering solution.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Array | Existing versions of a solution object. See also ClusteringSolutionVersion API. |
Example
The following example shows how to get all ClusteringSolution version objects and call the getVersionNumber() and getStatus() solution version methods on them.
Output:
ClusteringSolution - getLatestVersion()
Gets the latest version of a solution.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | ClusteringSolutionVersion object corresponding to the latest version of a ClusteringSolution(). |
Example
The following example shows how to get the latest version of a solution and return its training status.
Output:
ClusteringSolution - getName()
Gets the name of the object to use for interaction with the store.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Name of the solution object. |
Example
The following example shows how to update ClusteringSolution dataset information and print the name of the object.
Output:
ClusteringSolution - getProperties()
Gets solution object properties.
Name | Type | Description |
---|---|---|
None |
Example
The following example gets properties of a solution object in the store.
ClusteringSolution - getVersion(String version)
Gets a solution by provided version number.
Name | Type | Description |
---|---|---|
version | String | Existing version number of a solution. |
Type | Description |
---|---|
Object | Specified version of the ClusteringSolution() object on which you can call ClusteringSolutionVersion API methods. |
Example
The following example shows how to get the training status of a solution by version number.
Output:
ClusteringSolution - setActiveVersion(String version)
Activates a specified version of a solution in the store.
Name | Type | Description |
---|---|---|
version | String | Name of the ClusteringSolution() object version to activate. Activating this version deactivates any other version. |
Type | Description |
---|---|
None |
Example
The following example shows how to activate a solution version in the store.
ClusteringSolution - submitTrainingJob()
Submits a training job.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | ClusteringSolutionVersion object corresponding to the ClusteringSolution being trained. |
Example
The following example shows how to create a dataset, apply it to a solution, add the solution to a store, and submit the training job.
On this page
- ClusteringSolution - ClusteringSolution(Object config)
- ClusteringSolution - cancelTrainingJob()
- ClusteringSolution - getActiveVersion()
- ClusteringSolution - getAllVersions()
- ClusteringSolution - getLatestVersion()
- ClusteringSolution - getName()
- ClusteringSolution - getProperties()
- ClusteringSolution - getVersion(String version)
- ClusteringSolution - setActiveVersion(String version)
- ClusteringSolution - submitTrainingJob()