---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ClusteringSolution - Global

# ClusteringSolution - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated February 3, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 11 minutes to read

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.  
The solution setup-to-training flow is as follows:

1. Create a dataset using the [DatasetDefinition](https://servicenow-prod.fluidtopics.net/5PRN6njd2wF_we1ri_egPw#DatasetDefinitionAPI "The DatasetDefinition API provides methods to identify a set of records including a table name, columns, and row selection criteria to use as input for ML training algorithms. Datasets don't contain the actual data.") API.
2. Use the [constructor](https://servicenow-prod.fluidtopics.net/1UtA64JFiuMrifx24cx4og#ClusteringSol-ClusteringSolution_O "Creates a cluster solution.") to create a clustering solution object.
3. Add the solution object to the clustering solution store using the [ClusteringSolutionStore - add()](https://servicenow-prod.fluidtopics.net/WcUoxo34dGjAbOCgbnQYMQ#ClusteringStore-add_O "Adds a new solution object to the store and returns a unique name.") method.
4. Train the solution using the [submitTrainingJob()](https://servicenow-prod.fluidtopics.net/1UtA64JFiuMrifx24cx4og#ClusteringSol-submitTrainingJob "Submits a training job.") method. This creates a version of the object that you can manage using the [ClusteringSolutionVersion](https://servicenow-prod.fluidtopics.net/mjmzeuQMD3leCpklpCDXPQ#ClusteringSolutionVersionAPI "The ClusteringSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") API.

{#ClusteringSolutionAPI__ol_mmm_n1c_dmb}  
Note:  
This API runs with full privileges before the Vancouver Patch 7 Hotfix 2b and Washington DC Patch 7 releases. With later releases, grant access using ACLs. For more information see [Query ACLs](https://www.servicenow.com/docs/access?context=query-acl-rule&version=xanadu&pubname=xanadu-platform-security&ft:locale=en-US).

For usage guidelines, refer to [Using ML APIs](https://www.servicenow.com/docs/access?context=using-ml-apis&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US).

## ClusteringSolution - ClusteringSolution(Object config) {#ariaid-title2}

Creates a cluster solution.
{#ClusteringSol-ClusteringSolution_O__table_gm2_yt5_flb__entry__3}{#ClusteringSol-ClusteringSolution_O__cluster-dbscan-distanceM-vals}{#ClusteringSol-ClusteringSolution_O__cluster-dbscan-epsilon-desc}{#ClusteringSol-ClusteringSolution_O__cluster-dbscan-minNeighbs-desc}{#ClusteringSol-ClusteringSolution_O__cluster-kmeans-targetC-desc}{#ClusteringSol-ClusteringSolution_O__solution-obj-domainN-default}{#ClusteringSol-ClusteringSolution_O__solution-cluster-minrec-desc}{#ClusteringSol-ClusteringSolution_O__solution-obj-stop-desc}

| Name | Type | Description |
|-|-|-|
| config | Object | JavaScript object containing configuration properties of the solution. { "algorithmConfig": {Object}, "clusterConcept": "String", "clusterConceptFieldNames": [Array], "dataset": {Object}, "domainName": "String", "groupByFieldName": "String", "groupUnclusteredRecords": Boolean, "inputFieldNames": [Array], "label": "String", "maxTimeWindowForUpdate" : Number, "minRecordsPerCluster" : Number, "minRowCount": "String", "processingLanguage": "String", "stopwords": [Array], "trainingFrequency": "String", "updateFrequency": "String" } |
| config.algorithmConfig | Object | Required. JavaScript object containing algorithm configuration properties. Property settings vary by the value set in the algorithm property. 'algorithmConfig': { "algorithm": "String", // See algorithmConfig.algorithm setting description for property settings based on algorithm } |
| config.algorithmConfig.algorithm | String | Method for encoding your solution. Valid values: * dbscan -- Density-Based Spatial Clustering of Applications with Noise (DBSCAN) clustering algorithm. Properties used with this algorithm: * distanceMetric * epsilon * minimumNeighbours {#ClusteringSol-ClusteringSolution_O__ul_cfy_mkk_xlb} * hdbscan -- Hierarchical Density Based Spatial Clustering of Applications with Noise (HDBSCAN) clustering algorithm. Properties used with this algorithm: * minimumSamples {#ClusteringSol-ClusteringSolution_O__ul_o3n_zcw_wnb} * kmeans -- K-means clustering algorithm. Default. The targetCoverage property is used with this algorithm. {#ClusteringSol-ClusteringSolution_O__ul_wtd_l2k_xlb} Some users prefer DBSCAN because it doesn't require you to specify the number of clusters in the data before clustering. Properties for dbscan: 'algorithmConfig': { "algorithm": "dbscan", "distanceMetric": "String", "epsilon": Number, "minimumNeighbours": Number } Properties for hdbscan: 'algorithmConfig': { "algorithm": "hdbscan", "minimumSamples": Number } Properties for kmeans: 'algorithmConfig': { "algorithm": "kmeans", "targetCoverage": Number } |
| config.algorithmConfig.distanceMetric | String | DBSCAN algorithm only. Distance metric to scan for similar data objects. Valid values: levenshteinDistance |
| config.algorithmConfig.epsilon | Number | DBSCAN algorithm only. Decimal value between 0 and 1 representing the size of the neighborhood search radius. |
| config.algorithmConfig.minimumNeighbours | Number | DBSCAN algorithm only. Minimum number of neighbors required in a point to be a part of a cluster. For levenshteinDistance the value must be 1 so that no points are excluded from the dataset. |
| config.algorithmConfig.minimumSamples | Number | Minimum number of data samples in a neighborhood required to determine if a point is a core point. Default: None |
| config.algorithmConfig.targetCoverage | Number | K-means algorithm only. Percentile field to filter out records that are less similar to each other. |
| config.clusterConcept | String | Optional. Concept type. A concept is a set of words listed in descending order of frequency. To generate a TFIDF-based cluster concept, set the value to `tfidf`. Concept types are listed in the Clustering Definitions \[ml_capability_definition_clustering\] table. Default: Frequency-based cluster concept |
| config.clusterConceptFieldNames | Array | Optional. List of cluster concept field names. These values are external columns for creating a cluster concept and not used for cluster solution training. If external columns are provided, those columns are only used for the cluster concept and not for clustering solution training. Cluster concept fields are listed in the Clustering Definitions \[ml_capability_definition_clustering\] table. Default: Input text columns generate the cluster concept |
| config.dataset | Object | [DatasetDefinition](https://servicenow-prod.fluidtopics.net/5PRN6njd2wF_we1ri_egPw#DatasetDefinitionAPI "The DatasetDefinition API provides methods to identify a set of records including a table name, columns, and row selection criteria to use as input for ML training algorithms. Datasets don't contain the actual data.") object name. |
| config.domainName | String | Optional. Domain name associated with this dataset. See [Domain separation and Predictive Intelligence](https://www.servicenow.com/docs/access?context=domain-separation-predictive-intelligence&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US). Default: Current domain, for example, `"global"`. |
| config.groupByFieldName | String | Optional. Field name by which the system groups records into one or more clusters. In the following setup example, the system groups each type into an individual cluster, rendering 10 clusters. * groupByFieldName value is `'category'` * [DatasetDefinition](https://servicenow-prod.fluidtopics.net/5PRN6njd2wF_we1ri_egPw#DatasetDefinitionAPI "The DatasetDefinition API provides methods to identify a set of records including a table name, columns, and row selection criteria to use as input for ML training algorithms. Datasets don't contain the actual data.") tableName value is `'incident'` * Incident \[incident\] table has 10 category types {#ClusteringSol-ClusteringSolution_O__ul_bt4_y3h_dmb} |
| config.groupUnclusteredRecords | Boolean | Flag that indicates whether to group unclustered records in results. Valid values: * true: Group unclustered records separately in results. * false: Do not group unclustered records in results. Unclustered values (-1) display with the rest of the results. {#ClusteringSol-ClusteringSolution_O__ul_ar4_blq_wnb} Default: false |
| config.inputFieldNames | Array | List of input field names as strings. The model uses these fields used to make predictions. |
| config.label | String | Identifies the prediction task. |
| config.maxTimeWindowForUpdate | Number | Optional. Number of minutes preceding the model update point to look for records. For example, if the value is 15, the system only looks for records created in the preceding 15 minutes. By default, the system scans all records. |
| config.minRecordsPerCluster | Number | Optional. Minimum number of records to allow in any cluster. The value must be greater than or equal to 2. Default: 2 |
| config.minRowCount | String | Optional. Minimum number of records required in the dataset for training. Default: 10000 |
| config.processingLanguage | String | Processing language in two-letter ISO 639-1 language code format. |
| config.stopwords | Array | Optional. Preset list of strings that the system automatically generates based on the language property setting. For details, see [Create a custom stopwords list](https://www.servicenow.com/docs/access?context=create-custom-stopwords-list&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US). Default: English Stopwords |
| config.trainingFrequency | String | The frequency to retrain the model. Possible values: * every_30_days * every_60_days * every_90_days * every_120_days * every_180_days * run_once {#ClusteringSol-ClusteringSolution_O__ul_pmw_523_plb}Default: run_once |
| config.updateFrequency |   | The frequency at which the model for the solution definition must be rebuilt. Possible values: * do_not_update * every_1_day * every_1_hour * every_6_hours * every_12_hours * every_1_minute * every_15_minutes * every_30_minutes {#ClusteringSol-ClusteringSolution_O__ul_kjm_2jh_3mb}Default: do_not_update |
[Table 1. Parameters]

{#ClusteringSol-ClusteringSolution_O__table_gm2_yt5_flb}  
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.

    try{
        var myData = new sn_ml.DatasetDefinition({
            'tableName' : 'incident',
            'fieldNames' : ['category', 'short_description', 'state', 'description'],
            'encodedQuery' : 'activeANYTHING'
        });
          
        var mySolution = new sn_ml.ClusteringSolution({
            'label': "clustering solution",
            'dataset' : myData,
            'inputFieldNames':['short_description'],                
            'groupByFieldName' : 'category',        
            'algorithmConfig' : {
                'algorithm' : 'kmeans',
                'targetCoverage' : '90'
            }
        });
        
        // add solution
        var solutionName = sn_ml.ClusteringSolutionStore.add(mySolution);
        var solutionVersion = mySolution.submitTrainingJob();    
        var trainingStatus = solutionVersion.getStatus();
        gs.print(JSON.stringify(JSON.parse(trainingStatus), null, 2));
    ​
    } catch(ex){
        gs.print('Exception caught: '+ ex.getMessage());
    }

Output:

    {
      "state": "waiting_for_training",
      "percentComplete": "0",
      "hasJobEnded": "false"
    }

The following example shows how to include the 'description' field as a cluster concept
field.

    var myIncidentData = new sn_ml.DatasetDefinition({
        'tableName' : 'incident',
        'fieldNames' : ['category', 'short_description', 'description'],
    });

    var mySolution = new sn_ml.ClusteringSolution({
    	'label': 'clustering_test',
    	'dataset': myIncidentData,
    	'inputFieldNames': ['short_description'],
    	'clusterConceptFieldNames': ['description']
    });

    var solutionNameFromStore = sn_ml.ClusteringSolutionStore.add(mySolution);
    var myClassifier = mySolution.submitTrainingJob(); 

## ClusteringSolution - cancelTrainingJob() {#ariaid-title3}

Cancels a job for a solution object that has been submitted for training.
{#ClusteringSol-cancelTrainingJob__table_bpb_k3z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 2. Parameters]

{#ClusteringSol-cancelTrainingJob__table_bpb_k3z_llb} {#ClusteringSol-cancelTrainingJob__table_cpb_k3z_llb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 3. Returns]

{#ClusteringSol-cancelTrainingJob__table_cpb_k3z_llb}  
The following example shows how to cancel an existing
training job.

    var mySolution = sn_ml.ClusteringSolutionStore.get('ml_sn_global_global_clustering');

    mySolution.cancelTrainingJob();

## ClusteringSolution - getActiveVersion() {#ariaid-title4}

Gets the active ClusteringSolutionVersion object.
{#ClusteringSol-getActiveVersion__table_tvl_m3z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 4. Parameters]

{#ClusteringSol-getActiveVersion__table_tvl_m3z_llb} {#ClusteringSol-getActiveVersion__table_uvl_m3z_llb__entry__2}

| Type | Description |
|-|-|
| Object | Active [ClusteringSolutionVersion](https://servicenow-prod.fluidtopics.net/mjmzeuQMD3leCpklpCDXPQ#ClusteringSolutionVersionAPI "The ClusteringSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") object. |
[Table 5. Returns]

{#ClusteringSol-getActiveVersion__table_uvl_m3z_llb}  
The following example shows how to get an active
ClusteringSolution
version from the store and return its training status.

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

    gs.print(JSON.stringify(JSON.parse(mlSolution.getActiveVersion().getStatus()), null, 2));

Output:

    {
      "state": "solution_complete",
      "percentComplete": "100",
      "hasJobEnded": "true"
    }

## ClusteringSolution - getAllVersions() {#ariaid-title5}

Gets all versions of a clustering solution.
{#ClusteringSol-getAllVersions__table_tvl_m3z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 6. Parameters]

{#ClusteringSol-getAllVersions__table_tvl_m3z_llb} {#ClusteringSol-getAllVersions__table_uvl_m3z_llb__entry__2}

| Type | Description |
|-|-|
| Array | Existing versions of a solution object. See also [ClusteringSolutionVersion](https://servicenow-prod.fluidtopics.net/mjmzeuQMD3leCpklpCDXPQ#ClusteringSolutionVersionAPI "The ClusteringSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") API. |
[Table 7. Returns]

{#ClusteringSol-getAllVersions__table_uvl_m3z_llb}  
The following example shows how to get all ClusteringSolution
version objects and call the getVersionNumber() and
getStatus() solution version methods on them.

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

    var mlSolutionVersions = mlSolution.getAllVersions();

    for (i = 0; i < mlSolutionVersions.length; i++) {
    gs.print("Version " + mlSolutionVersions[i].getVersionNumber() + " Status: " + mlSolutionVersions[i].getStatus() +"\n");
    };

Output:

    Version 3 Status: {"state":"solution_complete","percentComplete":"100","hasJobEnded":"true"}

    Version 2 Status: {"state":"solution_complete","percentComplete":"100","hasJobEnded":"true"}

    Version 1 Status: {"state":"solution_cancelled","percentComplete":"0","hasJobEnded":"true"}

## ClusteringSolution - getLatestVersion() {#ariaid-title6}

Gets the latest version of a solution.
{#ClusteringSol-getLatestVersion__table_tvl_m3z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 8. Parameters]

{#ClusteringSol-getLatestVersion__table_tvl_m3z_llb} {#ClusteringSol-getLatestVersion__table_uvl_m3z_llb__entry__2}

| Type | Description |
|-|-|
| Object | [ClusteringSolutionVersion](https://servicenow-prod.fluidtopics.net/mjmzeuQMD3leCpklpCDXPQ#ClusteringSolutionVersionAPI "The ClusteringSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") object corresponding to the latest version of a [ClusteringSolution()](https://servicenow-prod.fluidtopics.net/1UtA64JFiuMrifx24cx4og#ClusteringSol-ClusteringSolution_O "Creates a cluster solution."). |
[Table 9. Returns]

{#ClusteringSol-getLatestVersion__table_uvl_m3z_llb}  
The following example shows how to get the latest version of a solution
and return its training status.{#ClusteringSol-getLatestVersion__mlsol-getLatestVersion-example}

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

    gs.print(JSON.stringify(JSON.parse(mlSolution.getLatestVersion().getStatus()), null, 2));

Output:

    {
      "state": "solution_complete",
      "percentComplete": "100",
      "hasJobEnded": "true"
    }

## ClusteringSolution - getName() {#ariaid-title7}

Gets the name of the object to use for interaction with the store.
{#ClusteringSol-getName__table_pps_43z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 10. Parameters]

{#ClusteringSol-getName__table_pps_43z_llb} {#ClusteringSol-getName__table_qps_43z_llb__entry__2}

| Type | Description |
|-|-|
| String | Name of the solution object. |
[Table 11. Returns]

{#ClusteringSol-getName__table_qps_43z_llb}  
The following example shows how to update
ClusteringSolution
dataset information and print the name of the object.

    // Update solution
    var myIncidentData = new sn_ml.DatasetDefinition({
       'tableName' : 'incident',
       'fieldNames' : ['category', 'short_description', 'priority'],
       'encodedQuery' : 'activeANYTHING'
    });

    var eligibleFields = JSON.parse(myIncidentData.getEligibleFields('clustering'));

    var myCluster = new sn_ml.ClusteringSolution({
       'label': "my clustering solution",
       'dataset' : myIncidentData,
       'inputFieldNames': eligibleFields['eligibleInputFieldNames'],
       'predictedFieldName': 'category'
    });

    // update solution
    sn_ml.ClusteringSolutionStore.update('ml_x_snc_global_global_clustering_solution', myCluster);

    // print solution name
    gs.print('Solution Name: '+myCluster.getName());

Output:

    Solution Name: ml_x_snc_global_global_clustering_solution

## ClusteringSolution - getProperties() {#ariaid-title8}

Gets solution object properties.
{#ClusteringSol-getProperties__table_pps_43z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 12. Parameters]

{#ClusteringSol-getProperties__table_pps_43z_llb} {#ClusteringSol-getProperties__table_qps_43z_llb__entry__2}{#ClusteringSol-getProperties__solution-obj-group-desc}

| Type | Description |
|-|-|
| Object | Contents of the Dataset and [ClusteringSolution()](https://servicenow-prod.fluidtopics.net/1UtA64JFiuMrifx24cx4og#ClusteringSol-ClusteringSolution_O "Creates a cluster solution.") object details in the [ClusteringSolutionStore](https://servicenow-prod.fluidtopics.net/WcUoxo34dGjAbOCgbnQYMQ#ClusteringSolutionStoreAPI "Enables storing and retrieving solutions."). { "algorithmConfig": {Object}, "datasetProperties": {Object}, "domainName": "String", "groupByFieldName": "String", "inputFieldNames": [Array], "label": "String", "minRecordsPerCluster" : Number, "name": "String", "processingLanguage": "String", "scope": "String", "stopwords": [Array], "trainingFrequency": "String", "updateFrequency": "String" } |
| \<Object\>.algorithmConfig | JavaScript object containing algorithm configuration properties. Property results vary by the value set in the algorithm property. 'algorithmConfig' : { "algorithm": "String", // See algorithmConfig.algorithm setting description for property settings based on algorithm } Data type: Object. |
| \<Object\>.algorithmConfig.algorithm | Method for encoding your solution. Properties for dbscan: 'algorithmConfig': { "algorithm": "dbscan", "distanceMetric": "String", "epsilon": Number, "minimumNeighbours": Number } Properties for kmeans: 'algorithmConfig': { "algorithm": "kmeans", "targetCoverage": Number } Data type: String. |
| \<Object\>.algorithmConfig.distanceMetric | DBSCAN algorithm only. Distance metric to scan for similar data objects. Data type: String. |
| \<Object\>.algorithmConfig.epsilon | DBSCAN algorithm only. Decimal value between 0 and 1 representing the size of the neighborhood search radius. Data type: Number. |
| \<Object\>.algorithmConfig.minimumNeighbours | DBSCAN algorithm only. Minimum number of neighbors required in a point to be a part of a cluster. For levenshteinDistance the value must be 1 so that no points are excluded from the dataset. Data type: Number. |
| \<Object\>.algorithmConfig.targetCoverage | K-means algorithm only. Percentile field to filter out records that are less similar to each other. Data type: Number. |
| \<Object\>.datasetProperties | Lists the properties of the [DatasetDefinition()](https://servicenow-prod.fluidtopics.net/5PRN6njd2wF_we1ri_egPw#DDef-DatasetDefinition_O "Creates an instance of the DatasetDefinition class, enabling you to define a dataset by table name, fields, and query.") object associated with the solution. { "encodedQuery": "String", "fieldDetails": [Array], "fieldNames": [Array], "tableName": "String" } Data type: Object. |
| \<Object\>.datasetProperties.tableName | Name of the table for the dataset. For example, `"tableName" : "Incident"`. Data type: String. |
| \<Object\>.datasetProperties.fieldNames | List of field names from the specified table as strings. For example, `"fieldNames" : ["short_description", "priority"]`. Data type: Array. |
| \<Object\>.datasetProperties.fieldNames.fieldDetails | List of JavaScript objects that specify field properties. [ { "name": "String", "type": "String" } ] Data type: Array. |
| \<Object\>.datasetProperties.fieldNames.fieldDetails.\<object\>.name | Name of the field defining the type of information to restrict this dataset to. Data type: String. |
| \<Object\>.datasetProperties.fieldDetails.\<object\>.type | Machine-learning field type. Data type: String. |
| \<Object\>.datasetProperties.fieldDetails.encodedQuery | Encoded query string in standard Glide format. See [Encoded query strings](https://www.servicenow.com/docs/access?context=c_EncodedQueryStrings&version=xanadu&pubname=xanadu-platform-user-interface&ft:locale=en-US). Data type: String. |
| \<Object\>.domainName | Domain name associated with this dataset. See [Domain separation and Predictive Intelligence](https://www.servicenow.com/docs/access?context=domain-separation-predictive-intelligence&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US). Data type: String. |
| \<Object\>.groupByFieldName | Field name by which the system groups records into one or more clusters. Data type: String |
| \<Object\>.inputFieldNames | List of input field names as strings. The model uses these fields used to make predictions. Data type: String. |
| \<Object\>.label | Identifies the prediction task. { "label": "my first prediction" } Data type: String. |
| \<Object\>.minRecordsPerCluster | Minimum number of records to allow in any cluster. Data type: Number. |
| \<Object\>.name | System-assigned name. Data type: String. |
| \<Object\>.predictedFieldName | Identifies a field to be trained for predictability. Data type: String. |
| \<Object\>.processingLanguage | Processing language in two-letter ISO 639-1 language code format. Data type: String. |
| \<Object\>.scope | Object scope. Currently the only valid value is `global`. Data type: String |
| \<Object\>.stopwords | Optional. Preset list of strings that the system automatically generates based on the language property setting. For details, see [Create a custom stopwords list](https://www.servicenow.com/docs/access?context=create-custom-stopwords-list&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US). Data type: Array. |
| \<Object\>.trainingFrequency | The frequency to retrain the model. Possible values: * every_30_days * every_60_days * every_90_days * every_120_days * every_180_days * run_once {#ClusteringSol-getProperties__ul_pmw_523_plb}Default: run_once Data type: String. |
| \<Object\>.updateFrequency | The frequency at which the model for the solution definition must be rebuilt. Possible values: * do_not_update * every_1_day * every_1_hour * every_6_hours * every_12_hours * every_1_minute * every_15_minutes * every_30_minutes {#ClusteringSol-getProperties__ul_kjm_2jh_3mb}Default: do_not_update Datatype: String |
[Table 13. Returns]

{#ClusteringSol-getProperties__table_qps_43z_llb}  
The following example gets properties of a solution object in the store.{#ClusteringSol-getProperties__mlsol-getProps-example-other2}

    var myCluster = new sn_ml.ClusteringSolutionStore.get("ml_x_snc_global_global_clustering_solution");

    gs.print(JSON.stringify(JSON.parse(myCluster.getProperties()), null, 2));

Output:

    *** Script: {
      "algorithmConfig": {
        "algorithm": "kmeans",
        "targetCoverage": "90"
      },
      "datasetProperties": {
        "tableName": "incident",
        "fieldNames": [
          "category",
          "short_description",
          "state",
          "description"
        ],
        "encodedQuery": "activeANYTHING"
      },
      "domainName": "global",
      "groupByFieldName": "category",
      "inputFieldNames": [
        "short_description"
      ],
      "label": "clustering solution",
      "minRecordsPerCluster": 2,
      "name": "ml_x_snc_global_global_clustering_solution",
      "processingLanguage": "en",
      "scope": "global",
      "stopwords": [
        "Default English Stopwords"
      ],
      "trainingFrequency": "run_once",
      "updateFrequency": "do_not_update"
    }}

## ClusteringSolution - getVersion(String version) {#ariaid-title9}

Gets a solution by provided version number.
{#ClusteringSol-getVersion_S__table_pps_43z_llb__entry__3}{#ClusteringSol-getVersion_S__mlsol-gerversion-returns-other}

| Name | Type | Description |
|-|-|-|
| version | String | Existing version number of a solution. |
[Table 14. Parameters]

{#ClusteringSol-getVersion_S__table_pps_43z_llb} {#ClusteringSol-getVersion_S__table_qps_43z_llb__entry__2}

| Type | Description |
|-|-|
| Object | Specified version of the [ClusteringSolution()](https://servicenow-prod.fluidtopics.net/1UtA64JFiuMrifx24cx4og#ClusteringSol-ClusteringSolution_O "Creates a cluster solution.") object on which you can call [ClusteringSolutionVersion](https://servicenow-prod.fluidtopics.net/mjmzeuQMD3leCpklpCDXPQ#ClusteringSolutionVersionAPI "The ClusteringSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") API methods. |
[Table 15. Returns]

{#ClusteringSol-getVersion_S__table_qps_43z_llb}  
The following example shows how to get the training status of a solution
by version number.{#ClusteringSol-getVersion_S__mlsol-gerversion-example-other}

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

    gs.print(JSON.stringify(JSON.parse(mlSolution.getVersion('1').getStatus()), null, 2));

Output:

    {
      "state": "solution_complete",
      "percentComplete": "100",
      "hasJobEnded": "true"
    }

## ClusteringSolution - setActiveVersion(String version) {#ariaid-title10}

Activates a specified version of a solution in the store.
{#ClusteringSol-setActiveVersion_S__table_pps_43z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| version | String | Name of the [ClusteringSolution()](https://servicenow-prod.fluidtopics.net/1UtA64JFiuMrifx24cx4og#ClusteringSol-ClusteringSolution_O "Creates a cluster solution.") object version to activate. Activating this version deactivates any other version. |
[Table 16. Parameters]

{#ClusteringSol-setActiveVersion_S__table_pps_43z_llb} {#ClusteringSol-setActiveVersion_S__table_qps_43z_llb__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 17. Returns]

{#ClusteringSol-setActiveVersion_S__table_qps_43z_llb}  
The following example shows how to activate a solution version in the store.{#ClusteringSol-setActiveVersion_S__mlsol-setActive-example2}

    sn_ml.ClusteringSolution.setActiveVersion("ml_incident_categorization");

## ClusteringSolution - submitTrainingJob() {#ariaid-title11}

Submits a training job.
Note:  
Before running this method, you must first add a solution to the store using the [ClusteringSolutionStore - add()](https://servicenow-prod.fluidtopics.net/WcUoxo34dGjAbOCgbnQYMQ#ClusteringStore-add_O "Adds a new solution object to the store and returns a unique name.") method.
{#ClusteringSol-submitTrainingJob__table_xmd_33z_llb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 18. Parameters]

{#ClusteringSol-submitTrainingJob__table_xmd_33z_llb} {#ClusteringSol-submitTrainingJob__table_ymd_33z_llb__entry__2}

| Type | Description |
|-|-|
| Object | [ClusteringSolutionVersion](https://servicenow-prod.fluidtopics.net/mjmzeuQMD3leCpklpCDXPQ#ClusteringSolutionVersionAPI "The ClusteringSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") object corresponding to the [ClusteringSolution](https://servicenow-prod.fluidtopics.net/1UtA64JFiuMrifx24cx4og#ClusteringSol-ClusteringSolution_O "Creates a cluster solution.") being trained. |
[Table 19. Returns]

{#ClusteringSol-submitTrainingJob__table_ymd_33z_llb}  
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.{#ClusteringSol-submitTrainingJob__mlsol-submit-example-nonSol2}

    // Create a dataset 
    var myData = new sn_ml.DatasetDefinition({

      'tableName' : 'incident',
      'fieldNames' : ['assignment_group', 'short_description', 'description'],
      'encodedQuery' : 'activeANYTHING'

    });

    // Create a solution 
    var mySolution = new sn_ml.ClusteringSolution({

      'label': "my solution definition",
      'dataset' : myData,
      'predictedFieldName' : 'assignment_group',
      'inputFieldNames':['short_description']

    });

    // Add the solution to the store to later be able to retrieve it.
    var my_unique_name = sn_ml.ClusteringSolutionStore.add(mySolution);

    // Train the solution - this is a long running job 
    var myClusterVersion = mySolution.submitTrainingJob();


