---
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


---

# MLSolutionResult - Global (deprecated)

# MLSolutionResult - Global (deprecated) {#ariaid-title1}

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

The MLSolutionResult API provides methods for managing cluster information and members of a clustering solution. You can embed the results in business logic.  
Note:  
This API has been deprecated and is intended to be removed in a future release. 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) for the most recent guidelines.

## MLSolutionResult - MLSolutionResult() {#ariaid-title2}

Instantiates a new MLSolutionResult object.
{#MLSR-MLSolutionResult__table_btj_twt_rhb__entry__3}

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

{#MLSR-MLSolutionResult__table_btj_twt_rhb}

## MLSolutionResult - findActiveSolution(String solutionName) {#ariaid-title3}

Returns the solution object.
This method only returns the solutions if the ml_solution definition and solution are
active (that is, trained). For information, see [Create and train a
clustering solution](https://www.servicenow.com/docs/access?context=create-clustering-solution&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US) .
{#MLSR-findActiveSolution_S__table_hqw_pbm_yfb__entry__3}

| Name | Type | Description |
|-|-|-|
| solutionName | String | Name of the clustering ml_solution record. |
[Table 2. Parameters]

{#MLSR-findActiveSolution_S__table_hqw_pbm_yfb} {#MLSR-findActiveSolution_S__table_iqw_pbm_yfb__entry__2}

| Type | Description |
|-|-|
| Object | Clustering solution object for the specified `solutionName` if the ml_solution definition and solution is active, null otherwise. |
[Table 3. Returns]

{#MLSR-findActiveSolution_S__table_iqw_pbm_yfb}  

    var solutionName = 'ml_incident_assignment';
      var MLS = new MLSolutionResult();
      var solution = MLS.findActiveSolution(solutionName);
      gs.print(solution);
            
## MLSolutionResult - getClusterAssignments(String solutionName, Object options) {#ariaid-title4}

Returns all members of a clustering solution.
{#MLSR-getClusterAssignments_S_O__table_t1q_hxt_rhb__entry__3}

| Name | Type | Description |
|-|-|-|
| solutionName | String | Name of active cluster solution. |
| options | Object | Optional. Narrows down the returned results by group and level within a clustering solution. Default: Return cluster memberships for all clusters. |
| options.segmentation_field | String | Optional. Identifies the segmentation field for which to retrieve cluster memberships, for example, assignment group. This field provides the same grouping as options provided via Use Group By check box in Clustering Solution Definitions table. Information provided varies by table selected in the Table field. For information, see [Create and train a clustering solution](https://www.servicenow.com/docs/access?context=create-clustering-solution&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US) . |
| options.cluster_id | String | Optional. The sys_id from the ml_cluster_summary table. |
| options.rec_sys_id | String | Optional. The sys_id from the table record the cluster solution is based on. |
[Table 4. Parameters]

{#MLSR-getClusterAssignments_S_O__table_t1q_hxt_rhb} {#MLSR-getClusterAssignments_S_O__table_u1q_hxt_rhb__entry__2}

| Type | Description |
|-|-|
| Array | Array of outcome objects including: * segmentation -- Field name by which to group data * cluster_num -- Unique cluster number within a solution of clusters (that is, label) * rec_sys_id -- The sys_id from the table record that the cluster solution is based on * rec_display_id -- Name of the record associated with the record sys_id. {#MLSR-getClusterAssignments_S_O__ul_oz5_tv5_rhb} |
[Table 5. Returns]

{#MLSR-getClusterAssignments_S_O__table_u1q_hxt_rhb}  
The following example shows how to return all cluster members for a solution without
setting values for the options object.

    var solutionName = "<Name_of_Active_Cluster_Solution>";
    var solutionResult = new MLSolutionResult();
    var outcome_array = solutionResult.getClusterAssignments(solutionName);
    for (var i = 0; i < outcome_array.length; i++) {
       gs.print(outcome_array [i].segmentation + ' ' + outcome_array [i].cluster_num + ' ' + outcome_array [i].rec_sys_id + ' ' + outcome_array [i].rec_display_id);
    }

The following example shows how to return all cluster members for one record using
options.rec_sys_id.

    var now_GR = new GlideRecord('incident');
    now_GR.get('sys_id');

    var solutionName = "solution_example";
    var solutionResult = new MLSolutionResult();
    var options = { "rec_sys_id": now_GR.getUniqueValue() };
    var outcome_array = solutionResult.getClusterAssignments(solutionName, options);
    for (var i = 0; i < outcome_array.length; i++) {
       gs.print(outcome_array [i].segmentation + ' ' + outcome_array [i].cluster_num + ' ' + outcome_array [i].rec_sys_id + ' ' + outcome_array [i].rec_display_id);
    }

## MLSolutionResult - getClusterInfo(String solutionName, Object options) {#ariaid-title5}

Returns all outcome information for a clustering solution.
{#MLSR-getClusterInfo_S_O__table_ak2_xcn_rhb__entry__3}

| Name | Type | Description |
|-|-|-|
| solutionName | String | Name of active cluster solution. |
| options | Object | Optional. Narrows down the returned results by group and level within a clustering solution. Default: Return cluster memberships for all clusters. |
| options.segmentation_field | String | Optional. Identifies the segmentation field for which to retrieve cluster memberships, for example, assignment group. This field provides the same grouping as options provided via Use Group By check box in Clustering Solution Definitions table. Information provided varies by table selected in the Table field. For information, see [Create and train a clustering solution](https://www.servicenow.com/docs/access?context=create-clustering-solution&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US). |
| options.cluster_id | String | Optional. The sys_id from the ml_cluster_summary table. |
[Table 6. Parameters]

{#MLSR-getClusterInfo_S_O__table_ak2_xcn_rhb} {#MLSR-getClusterInfo_S_O__table_bk2_xcn_rhb__entry__2}

| Type | Description |
|-|-|
| Array | Array of outcome objects including: * segmentation -- Field name by which to group data * cluster_num -- Unique cluster number within a solution of clusters (that is, label) * total_members -- Number of records in cluster (that is, size) * cluster_quality -- Cluster quality percentile value {#MLSR-getClusterInfo_S_O__ul_oz5_tv5_rhb} |
[Table 7. Returns]

{#MLSR-getClusterInfo_S_O__table_bk2_xcn_rhb}  

    var solutionName = "solution_example";
    var solutionResult = new MLSolutionResult();
    var outcome_array = solutionResult.getClusterInfo(solutionName);
    for (var i = 0; i < outcome_array.length; i++) {
    gs.print(outcome_array[i].segmentation + ' ' + outcome_array[i].cluster_num + ' ' + outcome_array[i].total_members + ' ' + outcome_array[i].cluster_quality);
    }


