SimilaritySolution - Global
-
- UpdatedJan 30, 2025
- 6 minutes to read
- Yokohama
- API reference
The SimilaritySolution 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.
- Build an encoder using the Encoder API.
- Use the constructor to create a similarity solution object.
- Add the solution object to the similarity solution store using the SimilaritySolutionStore - add() method.
- Train the solution using the submitTrainingJob() method. This creates a version of the object that you can manage using the SimilaritySolutionVersion API.
- Get predictions using the SimilaritySolutionVersion – predict() method.
For usage guidelines, refer to Using ML APIs.
SimilaritySolution - SimilaritySolution(Object config)
Creates a similarity solution.
Example
The following example shows how to create an object and add it to the SimilaritySolution store.
SimilaritySolution - 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.
SimilaritySolution - getActiveVersion()
Gets the active SimilaritySolutionVersion object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | Active SimilaritySolutionVersion object. |
Example
The following example shows how to get an active SimilaritySolution version from the store and return its training status.
Output:
SimilaritySolution - getAllVersions()
Gets all versions of a SimilaritySolution object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Array | Existing versions of a solution object. See also SimilaritySolutionVersion API. |
Example
The following example shows how to get all SimilaritySolution version objects and call the getVersionNumber() and getStatus() solution version methods on them.
Output:
SimilaritySolution - getLatestVersion()
Gets the latest version of a solution.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | SimilaritySolutionVersion object corresponding to the latest version of a SimilaritySolution. |
Example
The following example shows how to get the latest version of a solution and return its training status.
Output:
SimilaritySolution - 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 SimilaritySolution dataset information and print the name of the object.
Output:
SimilaritySolution - getProperties()
Gets solution object properties.
Name | Type | Description |
---|---|---|
None |
Example
The following example gets properties of a solution object in the store.
SimilaritySolution - 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 SimilaritySolution() object on which you can call SimilaritySolutionVersion API methods. |
Example
The following example shows how to get the training status of a solution by version number.
Output:
SimilaritySolution - setActiveVersion(String version)
Activates a specified version of a solution in the store.
Name | Type | Description |
---|---|---|
version | String | Name of the SimilaritySolution() 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.
SimilaritySolution - submitTrainingJob()
Submits a training job.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | SimilaritySolutionVersion object corresponding to the SimilaritySolution being trained. |
Example
On this page
- SimilaritySolution - SimilaritySolution(Object config)
- SimilaritySolution - cancelTrainingJob()
- SimilaritySolution - getActiveVersion()
- SimilaritySolution - getAllVersions()
- SimilaritySolution - getLatestVersion()
- SimilaritySolution - getName()
- SimilaritySolution - getProperties()
- SimilaritySolution - getVersion(String version)
- SimilaritySolution - setActiveVersion(String version)
- SimilaritySolution - submitTrainingJob()