{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":732,"path":"api-reference/server-api-reference/ClusteringSolutionVersionAPI.md","title":"ClusteringSolutionVersion - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# ClusteringSolutionVersion- Global\n\nThe ClusteringSolutionVersion API is a scriptable object used in Predictive Intelligence stores.\n\nThis API requires the Predictive Intelligence plugin \\(com.glide.platform\\_ml\\) and is provided within the `sn_ml` namespace.\n\nIt is used for working with solution versions based on [ClusteringSolution API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md) objects in the [ClusteringSolution store](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionStoreAPI.md).\n\nThe system creates a solution version each time you train a solution definition. Most versions are created during scheduled solution training.\n\nMethods in this API are accessible using the following ClusteringSolution methods:\n\n-   [getActiveVersion\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md)\n-   [getAllVersions\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md)\n-   [getLatestVersion\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md)\n-   [getVersion\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md)\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## ClusteringSolutionVersion - cancelUpdateJob\\(\\)\n\nCancels an update job on a trainer.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|None| |\n\nThe following example shows how to cancel an active training job that has been submitted using the [submitTrainingJob\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md) method.\n\n```\nvar myCluster = new sn_ml.ClusteringSolutionStore.get(\"ml_x_snc_global_global_clustering_solution\");\nvar mlSolutionVersion = myCluster.getActiveVersion();\n\nmlSolutionVersion.cancelUpdateJob();\n```\n\n## ClusteringSolutionVersion - deleteClusterAssignments\\(Object options\\)\n\nDeletes cluster assignments from rows by position in table sequence or GlideDateTime.\n\n<table id=\"table_cwv_r3b_rlb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\noptions\n\n</td><td>\n\nObject\n\n</td><td>\n\nObject defining one option for deleting cluster assignments.**Note:** Only one delete option is valid.\n\n</td></tr><tr><td>\n\noptions.updatedUntil\n\n</td><td>\n\nString\n\n</td><td>\n\nDeletes rows for clusters with `updated_since` values occurring before this value. Format must be provided as [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeAPI.md).```\n{ \"updatedUntil\" : \"String\" }\n```\n\n</td></tr><tr><td>\n\noptions.sequenceUntil\n\n</td><td>\n\nString\n\n</td><td>\n\nDeletes rows for clusters with `insert_sequence` values occurring before this value in the ML Cluster Detail \\[ml\\_cluster\\_detail\\] table. The sequence position starting point value is 1. ```\n{ \"sequenceUntil\" : Number }\n```\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|Number|Number of rows deleted from the ML Cluster Detail \\[ml\\_cluster\\_detail\\] table.|\n\nThe following example shows how to delete rows for clusters with `updated_since` time preceding `'2020-06-28 02:50:53'`.\n\n```\nvar mlSolution = sn_ml.ClusteringSolutionStore.get(\"ml_x_snc_global_global_clustering_solution\");\n\nvar mlSolutionVersion = mlSolution.getActiveVersion();\n\nvar options = {};\noptions.updatedUntil = '2020-06-28 02:50:53';\n\nvar results = mlSolutionVersion.deleteClusterAssignments(options);\n\ngs.print(\"Number of deleted rows: \"+results);\n```\n\nOutput:\n\n```\nNumber of deleted rows: 6417\n```\n\nThe following example shows how to delete rows for clusters with `updated_since` that are sequentially positioned prior to `1000`.\n\n```\nvar mlSolution = sn_ml.ClusteringSolutionStore.get(\"ml_x_snc_global_global_clustering_solution\");\n\nvar mlSolutionVersion = mlSolution.getActiveVersion();\n\nvar options = {};\noptions.sequenceUntil = 1000;\n\nvar results = mlSolutionVersion.deleteClusterAssignments(options);\n\ngs.print(\"Number of deleted rows: \"+results);\n```\n\nOutput:\n\n```\nNumber of deleted rows: 999\n```\n\n## ClusteringSolutionVersion - getClusterAssignments\\(Object options\\)\n\nGets assignments for a clustering solution.\n\n<table id=\"table_gby_x2w_plb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\noptions\n\n</td><td>\n\nObject\n\n</td><td>\n\nValues to use to narrow down the returned results by group, level, system update times, and table row number within a clustering solution. Minimum of one argument must be specified.```\n{\n     \"cluster_id\": \"String\",\n     \"group_by\": \"String\",\n     \"limit\": Number,\n     \"sequenceSince\": Number,\n     \"sequenceUntil\": Number,\n     \"topNPerCluster\": Number,\n     \"updatedSince\": \"String\",\n     \"updatedUntil\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\noptions.cluster\\_id\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Cluster ID of a trained solution in the Cluster Summary \\[ml\\_cluster\\_summary\\] table.\n\n</td></tr><tr><td>\n\noptions.group\\_by\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Identifies the segmentation field for which to retrieve cluster memberships, for example, assignment\\_group.This field provides the same grouping as options provided in the **Use Group By** check box in the **Clustering Definition** form. The information provided varies based on the table selected in the **Table** field. For more information, see [Create and train a clustering solution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/create-clustering-solution.md).\n\n</td></tr><tr><td>\n\noptions.limit\n\n</td><td>\n\nNumber\n\n</td><td>\n\nOptional. Maximum number of cluster assignments to retrieve.\n\n</td></tr><tr><td>\n\noptions.sequenceSince\n\n</td><td>\n\nNumber\n\n</td><td>\n\nStarting position in a table sequence. Returns information for clusters with insert\\_sequence enabled and positioned after this value in the ML Cluster Detail \\[ml\\_cluster\\_detail\\] table. The sequence position starting point value is 1.\n\n</td></tr><tr><td>\n\noptions.sequenceUntil\n\n</td><td>\n\nNumber\n\n</td><td>\n\nReturns assignments for clusters with `insert_sequence` values occurring before this value in the ML Cluster Detail \\[ml\\_cluster\\_detail\\] table. The sequence position starting point value is 1.\n\n</td></tr><tr><td>\n\noptions.topNPerCluster\n\n</td><td>\n\nNumber\n\n</td><td>\n\nNumber of top results to receive for each cluster.\n\n</td></tr><tr><td>\n\noptions.updatedSince\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Date and time. Returns information for clusters with `sys_updated_on` after the value provided in [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeAPI.md).\n\n</td></tr><tr><td>\n\noptions.updatedUntil\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Date and time. Returns information for clusters with `sys_updated_on` before the value provided in [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeAPI.md).\n\n</td></tr></tbody>\n</table><table id=\"table_u1q_hxt_rhb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nArray\n\n</td><td>\n\nList of objects containing cluster information in increasing order by cluster\\_id.```\n[\n    {\n       \"cluster_id\": \"String\",\n       \"group_by\": \"String\",\n       \"rec_display_id\": \"String\",\n       \"rec_sys_id\": \"String\"\n     }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;object&gt;.cluster\\_id\n\n</td><td>\n\nUnique cluster number within a solution of clusters.\n\n</td></tr><tr><td>\n\n&lt;object&gt;.group\\_by\n\n</td><td>\n\nIf grouped, name of the segmentation field associated with this cluster.\n\n</td></tr><tr><td>\n\n&lt;object&gt;.rec\\_display\\_id\n\n</td><td>\n\nRecord type and number.\n\n</td></tr><tr><td>\n\n&lt;object&gt;.rec\\_sys\\_id\n\n</td><td>\n\nRecord sys\\_id.\n\n</td></tr></tbody>\n</table>The following example shows how to use the **options** object to filter clustering results.\n\n```\nvar mlSolution = sn_ml.ClusteringSolutionStore.get(\"solution_name\");\n\nvar mlSolutionVersion = mlSolution.getActiveVersion();\n\nvar options = {};\noptions.clusterId = 56;\noptions.topNPerCluster = 10;\noptions.updatedUntil = '2020-01-17 23:16:14'; \noptions.updatedSince = '2020-01-17 23:16:13'; \noptions.sequenceUntil = 1000; \noptions.sequenceSince = 1100; \noptions.limit = 100;\n\nvar results = mlSolutionVersion.getClusterAssignments(options)\n\ngs.print(results);\n```\n\nOutput:\n\n```\n[{\"cluster_id\":\"1\",\"rec_display_id\":\"Incident\": \"INC0014483\",\"rec_sys_id\":\"04e33e7adb401300864adfea5e961900\",\"group_by\":\"network\"},\n {\"cluster_id\":\"1\",\"rec_display_id\":\"Incident\": \"INC0011133\",\"rec_sys_id\":\"5bd23af2db401300864adfea5e96194d\",\"group_by\":\"network\"}]\n```\n\n## ClusteringSolutionVersion - getClusterInfo\\(Object options\\)\n\nGets information for a specified clustering solution in the store. The purity measurement provides insights as a percentage for the clustering fields on which the purity is based.\n\n<table id=\"table_gby_x2w_plb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\noptions\n\n</td><td>\n\nObject\n\n</td><td>\n\nOptional. Object containing properties that enable filtering results within a clustering solution.```\n{\n  \"clusterId\": \"String\",     \n  \"groupBy\": \"String\",\n  \"limit\": \"String\",\n  \"recSysId\": \"String\",\n  \"sequenceSince\": Number,\n  \"sequenceUntil\": Number,\n  \"updatedSince\": \"String\",\n  \"updatedUntil\": \"String\"\n}\n```\n\n Default: Return cluster memberships for all clusters.\n\n</td></tr><tr><td>\n\noptions.clusterId\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Cluster ID of a trained solution in the Cluster Summary \\[ml\\_cluster\\_summary\\] table.\n\n</td></tr><tr><td>\n\noptions.groupBy\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Identifies the segmentation field for which to retrieve cluster memberships, for example, assignment\\_group.This field provides the same grouping as options provided in the **Use Group By** check box in the **Clustering Definition** form. The information provided varies based on the table selected in the **Table** field. For more information, see [Create and train a clustering solution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/create-clustering-solution.md).\n\n</td></tr><tr><td>\n\noptions.limit\n\n</td><td>\n\nNumber\n\n</td><td>\n\nOptional. Maximum number of cluster assignments to retrieve.\n\n</td></tr><tr><td>\n\noptions.recSysId\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Sys\\_id of a record by which to find cluster information.\n\n</td></tr><tr><td>\n\noptions.sequenceSince\n\n</td><td>\n\nNumber\n\n</td><td>\n\nStarting position in a table sequence. Returns information for clusters with insert\\_sequence enabled and positioned after this value in the ML Cluster Detail \\[ml\\_cluster\\_detail\\] table. The sequence position starting point value is 1.\n\n</td></tr><tr><td>\n\noptions.sequenceUntil\n\n</td><td>\n\nNumber\n\n</td><td>\n\nOptional. Ending position in a table sequence. Returns assignments for clusters with `insert_sequence` values occurring before this value in the ML Cluster Detail \\[ml\\_cluster\\_detail\\] table. The sequence position starting point value is 1.\n\n</td></tr><tr><td>\n\noptions.updatedSince\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Date and time. Returns information for clusters with `sys_updated_on` after the value provided in [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeAPI.md) format.\n\n</td></tr><tr><td>\n\noptions.updatedUntil\n\n</td><td>\n\nString\n\n</td><td>\n\nOptional. Date and time. Returns information for clusters with `sys_updated_on` before the value provided in [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeAPI.md).\n\n</td></tr></tbody>\n</table><table id=\"table_xk3_v3b_rlb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nArray\n\n</td><td>\n\nList of objects containing cluster information.```\n[\n  {   \n    \"cluster_concept\": \"String\",\n    \"cluster_id\": \"String\",\n    \"cluster_quality\": \"String\",\n    \"cluster_size\": \"String\",\n    \"group_by\": \"String\",\n    \"insert_sequence\": \"String\",\n    \"purity\": \"String\",\n    \"sys_updated_on\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;object&gt;.cluster\\_concept\n\n</td><td>\n\nSet of words that describe the cluster in descending order of frequency. Data type: String\n\n</td></tr><tr><td>\n\n&lt;object&gt;.cluster\\_id\n\n</td><td>\n\nUnique cluster number within a solution of clusters.\n\n</td></tr><tr><td>\n\n&lt;object&gt;.cluster\\_quality\n\n</td><td>\n\nNumber from 0 to 100. Higher numbers indicate higher cluster density. Data type: String\n\n</td></tr><tr><td>\n\n&lt;object&gt;.cluster\\_size\n\n</td><td>\n\nNumber of records in a cluster. Data type: String\n\n</td></tr><tr><td>\n\n&lt;object&gt;.group\\_by\n\n</td><td>\n\nIf grouped, name of the segmentation field associated with this cluster. Data type: String\n\n</td></tr><tr><td>\n\n&lt;object&gt;.insert\\_sequence\n\n</td><td>\n\nSequential position number of the cluster in the Cluster Summary \\[ml\\_cluster\\_summary\\] table.Data type: String\n\n</td></tr><tr><td>\n\n&lt;object&gt;.purity\n\n</td><td>\n\nPercentage value representing the purity of cluster quality.\n\n</td></tr><tr><td>\n\n&lt;object&gt;.sys\\_updated\\_on\n\n</td><td>\n\nSystem [GlideDateTime](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_GlideDateTimeScoped.md) value representing the date and time at which this cluster was last updated.Data type: String\n\n</td></tr></tbody>\n</table>The following example shows how to set the options object parameter and print the filtered cluster results.\n\n```\nvar mlSolution = sn_ml.ClusteringSolutionStore.get(\"ml_x_snc_global_global_clustering_solution\");\n\nvar mlSolutionVersion = mlSolution.getActiveVersion();\n\nvar options = {};\noptions.updatedSince = '2020-05-28 02:09:53'; \noptions.updatedUntil = '2020-05-28 03:15:00';\noptions.sequenceSince = 1;\noptions.limit = 10;\n\nvar results = mlSolutionVersion.getClusterInfo(options);\n\ngs.print(JSON.stringify(JSON.parse(results), null, 2));\n```\n\nOutput:\n\n```\n[\n  {\n    \"cluster_id\": \"1\",\n    \"cluster_quality\": \"100\",\n    \"cluster_size\": \"17\",\n    \"purity\": \"\",\n    \"insert_sequence\": \"8\",\n    \"group_by\": \"VPN   Customer\",\n    \"sys_updated_on\": \"2020-05-28 02:09:53\",\n    \"cluster_concept\": \"vpn instance connection ldap user log unable usability tunnel\"\n  },\n  {\n    \"cluster_id\": \"1\",\n    \"cluster_quality\": \"100\",\n    \"cluster_size\": \"10\",\n    \"purity\": \"\",\n    \"insert_sequence\": \"24\",\n    \"group_by\": \"Live Feed\",\n    \"sys_updated_on\": \"2020-05-28 02:09:53\",\n    \"cluster_concept\": \"feed live user note work disable group default usability sort\"\n  },\n  {\n    \"cluster_id\": \"1\",\n    \"cluster_quality\": \"100\",\n    \"cluster_size\": \"18\",\n    \"purity\": \"\",\n    \"insert_sequence\": \"40\",\n    \"group_by\": \"Integrations\",\n    \"sys_updated_on\": \"2020-05-28 02:09:53\",\n    \"cluster_concept\": \"integrate usability certificate error\"\n  },\n...\n]\n```\n\n## ClusteringSolutionVersion - getProperties\\(\\)\n\nGets solution object properties and version number.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_e2m_zwz_4lb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nObject\n\n</td><td>\n\nContents of the Dataset and [ClusteringSolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md) version details. Results vary by object property setup.```\n{\n  \"algorithmConfig\": {Object},\n  \"datasetProperties\": {Object},\n  \"domainName\": \"String\",\n  \"groupByFieldName\": \"String\", \n  \"inputFieldNames\": [Array],\n  \"isActive\": Boolean,\n  \"label\": \"String\",\n  \"minRecordsPerCluster\": Number,\n  \"name\": \"String\",\n  \"processingLanguage\": \"String\",\n  \"scope\": \"String\",\n  \"stopwords\": [Array],\n  \"trainingFrequency\": \"String\",\n  \"updateFrequency\": \"String\",\n  \"versionNumber\": Number\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.algorithmConfig\n\n</td><td>\n\nJavaScript object containing algorithm configuration properties. Property results vary by the value set in the **algorithm** property.Data type: Object\n\n```\n'algorithmConfig' : {\n  \"algorithm\": \"String\",  \n  // See algorithmConfig.algorithm setting description for property settings based on algorithm\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.algorithmConfig.algorithm\n\n</td><td>\n\nMethod for encoding your solution. Properties for **dbscan**:\n\n```\n'algorithmConfig': {\n  \"algorithm\": \"dbscan\",\n  \"distanceMetric\": \"String\",\n  \"epsilon\": Number,\n  \"minimumNeighbours\": Number\n}\n```\n\n Properties for **kmeans**:\n\n```\n'algorithmConfig': {\n  \"algorithm\": \"kmeans\",\n  \"targetCoverage\": Number\n}\n```\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.algorithmConfig.distanceMetric\n\n</td><td>\n\nDBSCAN algorithm only. Distance metric to scan for similar data objects. Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.algorithmConfig.epsilon\n\n</td><td>\n\nDBSCAN algorithm only. Decimal value between 0 and 1 representing the size of the neighborhood search radius. Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.algorithmConfig.minimumNeighbours\n\n</td><td>\n\nDBSCAN 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\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.algorithmConfig.targetCoverage\n\n</td><td>\n\nK-means algorithm only. Percentile field to filter out records that are less similar to each other. Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.datasetProperties\n\n</td><td>\n\nLists the properties of the [DatatsetDefinition](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/DatasetDefinitionAPI.md) object associated with the solution.\n\n ```\n{\n  \"encodedQuery\": \"String\",\n  \"fieldDetails\": [Array],\n  \"fieldNames\": [Array],\n  \"tableName\": \"String\"\n}\n```\n\n Data type: Object\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.datasetProperties.encodedQuery\n\n</td><td>\n\nEncoded query string in the standard platform format. See [Encoded query strings](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-user-interface/c_EncodedQueryStrings.md).Data type: String.\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.datasetProperties.fieldDetails\n\n</td><td>\n\nList of JavaScript objects that specify field properties. Data type: Array of Objects\n\n```\n[\n  {\n    \"name\": \"String\",\n    \"type\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.datasetProperties.fieldDetails.name\n\n</td><td>\n\nName of the field defining the type of information to restrict this dataset to. Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.datasetProperties.fieldDetails.type\n\n</td><td>\n\nMachine-learning field type. Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.datasetProperties.fieldNames\n\n</td><td>\n\nList of field names from the specified table as strings. For example, `\"fieldNames\" : [\"short_description\", \"priority\"]`. Data type: Array\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.datasetProperties.tableName\n\n</td><td>\n\nName of the table for the dataset. For example, `\"tableName\" : \"Incident\"`. Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.domainName\n\n</td><td>\n\nDomain name associated with this dataset. See [Domain separation and Predictive Intelligence](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/domain-separation-predictive-intelligence.md).Type: String\n\n</td></tr><tr><td>\n\nObject.groupByFieldName\n\n</td><td>\n\nField name by which the system groups records into one or more clusters. Data type: String\n\n</td></tr><tr><td>\n\nObject.inputFieldNames\n\n</td><td>\n\nList of input field names as strings. The model uses these fields used to make predictions. Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.isActive\n\n</td><td>\n\nFlag that indicates whether this version is active.Valid values:\n\n-   true: Version is active.\n-   false: Version is not active.\n\n Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.label\n\n</td><td>\n\nIdentifies the prediction task. ```\n{\n  \"label\": \"my first prediction\"\n}\n```\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.minRecordsPerCluster\n\n</td><td>\n\nMinimum number of records to allow in any cluster. Data type: Number\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.name\n\n</td><td>\n\nSystem-assigned name. Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.processingLanguage\n\n</td><td>\n\nProcessing language in two-letter ISO 639-1 language code format. Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.scope\n\n</td><td>\n\nObject scope. Currently the only valid value is `global`.Data type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.stopwords\n\n</td><td>\n\nOptional. Preset list of strings that the system automatically generates based on the **language** property setting. For details, see [Create a custom stopwords list](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/create-custom-stopwords-list.md). Data type: Array\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.trainingFrequency\n\n</td><td>\n\nThe frequency to retrain the model. Possible values:\n\n-   every\\_30\\_days\n-   every\\_60\\_days\n-   every\\_90\\_days\n-   every\\_120\\_days\n-   every\\_180\\_days\n-   run\\_once\n\nDefault: run\\_once\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.updateFrequency\n\n</td><td>\n\nThe frequency at which the model for the solution definition must be rebuilt. Possible values:\n\n-   do\\_not\\_update\n-   every\\_1\\_day\n-   every\\_1\\_hour\n-   every\\_6\\_hours\n-   every\\_12\\_hours\n-   every\\_1\\_minute\n-   every\\_15\\_minutes\n-   every\\_30\\_minutes\n\nDefault: do\\_not\\_update\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.versionNumber\n\n</td><td>\n\nVersion number of the ClusteringSolution object.\n\n</td></tr></tbody>\n</table>The following example gets properties of the active object version in the store.\n\n```\n// Get properties\nvar mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering_solution');\n\ngs.print(JSON.stringify(JSON.parse(mlSolution.getActiveVersion().getProperties()), null, 2));\n```\n\nOutput:\n\n```\n*** Script: {\n  \"algorithmConfig\": {\n    \"algorithm\": \"kmeans\",\n    \"targetCoverage\": \"90\"\n  },\n  \"datasetProperties\": {\n    \"tableName\": \"incident\",\n    \"fieldNames\": [\n      \"category\",\n      \"short_description\",\n      \"state\",\n      \"description\"\n    ],\n    \"encodedQuery\": \"activeANYTHING\"\n  },\n  \"domainName\": \"global\",\n  \"groupByFieldName\": \"category\",\n  \"inputFieldNames\": [\n    \"short_description\"\n  ],\n  \"isActive\": \"true\",\n  \"label\": \"clustering solution\",\n  \"minRecordsPerCluster\": 2,\n  \"name\": \"ml_x_snc_global_global_clustering_solution\",\n  \"processingLanguage\": \"en\",\n  \"stopwords\": [\n    \"Default English Stopwords\"\n  ],\n  \"updateFrequency\": \"do_not_update\",\n  \"versionNumber\": \"1\"\n}\n```\n\n## ClusteringSolutionVersion - getStatus\\(Boolean includeDetails\\)\n\nGets training completion status.\n\n<table id=\"table_xfh_vbw_plb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nincludeDetails\n\n</td><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether to return status **details**.Valid values:\n\n-   true: Return additional details.\n-   false: Don't return additional details.\n\nDefault: False\n\n</td></tr></tbody>\n</table><table id=\"table_yfh_vbw_plb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nObject\n\n</td><td>\n\nJavaScript object containing training status information for a [ClusteringSolution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/ClusteringSolutionAPI.md) object.```\n{\n  \"state\": \"String\",\n  \"percentComplete\": \"Number as a String\",\n  \"hasJobEnded\": \"Boolean value as a String\",\n  \"details\": {Object}\n}\n```\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.state\n\n</td><td>\n\nTraining completion state. If the training job reaches a terminal state, the job does not leave that state. If the state is terminal, the **hasJobEnded** property is set to `true`.Possible values:\n\n-   `fetching_files_for_training`\n-   `preparing_data`\n-   `retry`\n-   `solution_cancelled` \\(terminal\\)\n-   `solution_complete`\\(terminal\\)\n-   `solution_error` \\(terminal\\)\n-   `solution_incomplete`\n-   `training_request_received`\n-   `training_request_timed_out` \\(terminal\\)\n-   `training_solution`\n-   `uploading_solution`\n-   `waiting_for_training`\n\nData type: String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.hasJobEnded\n\n</td><td>\n\nFlag that indicates whether training is complete.Valid values:\n\n-   true: Training is complete.\n-   false: Training is incomplete.\n\nData type: Boolean value as a String\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.percentComplete\n\n</td><td>\n\nTraining percent complete. If the completion percentage is less than 100, the job might be in a terminal state. For example, if training times out.Data type: Number as a String\n\nRange: 0 thru 100\n\n</td></tr><tr><td>\n\n&lt;Object&gt;.details\n\n</td><td>\n\nObject containing a list of additional training details.Data type: Object\n\n</td></tr></tbody>\n</table>The following example shows a successful result with training complete.\n\n```\n// Get status\nvar mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_cluster_solution');\n\ngs.print(JSON.stringify(JSON.parse(mlSolution.getActiveVersion().getStatus(true), null, 2)));\n```\n\nOutput:\n\n```\n{\n \"state\":\"solution_complete\",\n \"percentComplete\":\"100\",\n \"hasJobEnded\":\"true\",\n \"details\":{\"stepLabel\":\"Solution Complete\"} // This information is only returned if getStatus(true);\n}\n```\n\nThe following example shows an unsuccessful result with training complete.\n\n```\n// Get status\nvar solutionName = 'ml_x_snc_global_global_cluster_solution';\nvar mlSolution = sn_ml.ClusteringSolutionStore.get(solutionName);\nvar trainingStatus = mlSolution.getLatestVersion().getStatus();\n\ngs.print(JSON.stringify(JSON.parse(trainingStatus), null, 2));\n```\n\nOutput:\n\n```\n{\n \"state\":\"solution_error\",\n \"percentComplete\":\"100\",\n \"hasJobEnded\":\"true\"\n}\n```\n\n## ClusteringSolutionVersion - getTopNPurityInfo\\(Object options\\)\n\nGets the top purity results for a clustering solution. The purity measurement provides insights as a percentage for the clustering fields on which the purity is based.\n\n<table id=\"table_q13_tk3_wnb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\noptions\n\n</td><td>\n\nObject\n\n</td><td>\n\nOptions that determine the number and format of the top cluster purity results.```\n{\n  \"clusterIds\": [Array],\n  \"groupBy\": [Array],\n  \"purityFields\": [Array],\n  \"topN\": Number,\n  \"topNFields\": Number\n}\n```\n\n</td></tr><tr><td>\n\noptions.clusterIds\n\n</td><td>\n\nArray\n\n</td><td>\n\nOptional. List of cluster IDs provided as strings. A cluster ID is provided in the Cluster Summary \\[ml\\_cluster\\_summary\\] table. If provided, this method returns purity cluster information for each specified cluster. Default: This method returns purity information for all clusters.\n\n</td></tr><tr><td>\n\noptions.groupBy\n\n</td><td>\n\nArray\n\n</td><td>\n\nOptional. List of group\\_by field strings from your table to help the system identify the class which is most frequent in the cluster. If provided, returns purity information for cluster solutions using group\\_by fields. The Cluster Summary \\[ml\\_cluster\\_summary\\] table lists clusters and any associated Group by values.This field only applies to clusters that use group by in the clustering definition. Eligible fields are listed in the **Table** field. For details on the group by feature, refer to [Create and train a clustering solution](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/intelligent-experiences/create-clustering-solution.md).\n\n</td></tr><tr><td>\n\noptions.purityFields\n\n</td><td>\n\nArray\n\n</td><td>\n\nOptional. List of purity field strings. If provided, this method only returns information for these purity fields. You can view purity values for a cluster in the Cluster Summary \\[ml\\_cluster\\_summary\\] table lists.**Note:** If both **purity\\_fields** and **top\\_n\\_fields** are provided, this method returns **top\\_n\\_fields** first, then selects fields from **purity\\_fields**.\n\n Default: Return purity information for all purity fields saved for the cluster.\n\n</td></tr><tr><td>\n\noptions.topN\n\n</td><td>\n\nNumber\n\n</td><td>\n\nOptional. Restricts the number of predictions to return to the highest values for each purity field.Maximum value: 10\n\n Default: Return all purity information for each purity field.\n\n</td></tr><tr><td>\n\noptions.topNFields\n\n</td><td>\n\nNumber\n\n</td><td>\n\nOptional. Restricts the number of purity fields returned to fields with the highest purity for each cluster.Maximum value: 10\n\n Default: Return all fields in the cluster.\n\n</td></tr></tbody>\n</table><table id=\"table_r13_tk3_wnb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nString\n\n</td><td>\n\nJSON-formatted string containing a list of clusters with purity fields and details.**Note:** Results vary based on settings made in the **options** input parameter.\n\n The following information illustrates how cluster purity results are sorted and categorized. Refer to the example for actual output.\n\n ```\n{\n  \"<clusterID>\":[\n    // List sorted by purity per field\n    { \"<fieldName>\":[\n      // List sorted by purity per field value\n      {\"<field_val1_1>\":\"<purity>\"},\n        // Additional field values\n    ]},\n    // Additional fields\n  ],\t  \n  // Additional clusters\n}\n```\n\n</td></tr><tr><td>\n\nString.&lt;clusterID&gt;\n\n</td><td>\n\nList of clusters arranged in descending order by purity value per cluster.Data type: Array\n\n</td></tr><tr><td>\n\nString.&lt;clusterID&gt;.&lt;field&gt;\n\n</td><td>\n\nList of objects representing purity fields arranged in descending order by purity value per field. The **options.top\\_n\\_fields** input object parameter property determines the number of fields returned.```\n\"<field>\":[{\"<field_val>\":\"<purity>\"}]}\n```\n\n Data type: Array\n\n</td></tr><tr><td>\n\nString.&lt;clusterID&gt;.&lt;field&gt;.&lt;values&gt;\n\n</td><td>\n\nList of objects containing field value and purity. For example, `{\"priority\":[{\"5\":\"100\"}]}` is a priority field with a score of 5 and a purity value of 100 percent. Results list in descending order by purity percentage. The **options.top\\_n** input object parameter property determines the number of results returned.Data type: Array\n\n</td></tr></tbody>\n</table>The following example shows how to get the top two purity results for the category field in specific cluster solutions.\n\n```\nvar solution = new GlideRecord('ml_solution');\nsolution.addQuery('sys_id', '<clustering_solution_sys_id>');\nsolution.addQuery('active', 'true');\nsolution.query();\n\nwhile (solution.next()) {\n\n  var options = {};\n  options.clusterIds = ['1', '3', '5'];\n  options.purityFields = ['category'];\n  options.topN = '2';\n  options.topNFields = '2';\n\n  var clustering = new sn_ml.ClusteringSolutionVersion(solution);\n  var results = clustering.getTopNPurityInfo(options);\n\n  gs.info(results);\n}\n```\n\nOutput displays purity insights based on the settings provided in the options parameter.\n\n```\n{\"1\":[{\"category\":[{\"network\":\"99.96\"},{\"inquiry\":\"0.04\"}]}],\"3\":[{\"category\":[{\"Systems Engineering\":\"100\"}]}],\n\"5\":[{\"category\":[{\"Security\":\"100\"}]}]}\n```\n\n## ClusteringSolutionVersion - getUpdateStatus\\(\\)\n\nGets the status of the most recent clustering solution update job.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n<table id=\"table_lx2_w3b_rlb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nString\n\n</td><td>\n\nState of the clustering solution update.States:\n\n-   Configuration or network error\n-   Error while updating solution\n-   Fetching files for updating\n-   Preparing data\n-   Unauthorized\n-   Update complete\n-   Updating is cancelled\n-   Updating request received\n-   Updating request timed out\n-   Updating solution\n-   Uploading\n-   Waiting\n\n</td></tr></tbody>\n</table>The following example shows how to get the update status of a clustering solution.\n\n```\nvar myCluster = new sn_ml.ClusteringSolutionStore.get(\"ml_x_snc_global_global_clustering_solution\");\n\ngs.print(JSON.stringify(myCluster.getActiveVersion().getUpdateStatus()));\n```\n\nOutput:\n\n```\n\"Update Complete\"\n```\n\n## ClusteringSolutionVersion - getVersionNumber\\(\\)\n\nGets the version number of a solution object.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Version number.|\n\nThe following example shows how to get a version number.\n\n```\n// Get version number\nvar mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering_solution');\n\ngs.print(\"Version number: \"+JSON.stringify(JSON.parse(mlSolution.getActiveVersion().getVersionNumber()), null, 2));\n```\n\nOutput:\n\n```\nVersion number: 1\n```\n\n## ClusteringSolutionVersion - submitUpdateJob\\(Object options\\)\n\nSubmits clustering update jobs with options to narrow results to a specific table and filter for matching records.\n\n<table id=\"table_gby_x2w_plb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\noptions\n\n</td><td>\n\nObject\n\n</td><td>\n\nJavaScript object containing options on which to base a clustering solution update.```\n{\n        \"filter\" : \"String\",\n        \"table\" : \"String\"\n    }\n```\n\n</td></tr><tr><td>\n\noptions.filter\n\n</td><td>\n\nString\n\n</td><td>\n\nEncoded query string in the standard platform format. Enables running an update job based on the filter provided.\n\n</td></tr><tr><td>\n\noptions.table\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the table on which to run an update job.\n\n</td></tr></tbody>\n</table>|Type|Description|\n|----|-----------|\n|None| |\n\nThe following example shows how to submit an update job.\n\n```\nvar myCluster = new sn_ml.ClusteringSolutionStore.get(\"ml_x_snc_global_global_clustering_solution\");\n\nvar options = {\"filter\" : \"precision\", \"table\" : \"incident\"};\n\nmyCluster.getActiveVersion().submitUpdateJob(options);\n```\n\n"}}