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


---

# ClassificationSolution - Global

# ClassificationSolution - Global {#ariaid-title1}

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

The ClassificationSolution 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. Optional. Build an encoder using the [Encoder](https://servicenow-prod.fluidtopics.net/lD2dU3P5hPYTlVdnWNZofg#EncoderAPI "The Encoder API provides a scriptable object used in Predictive Intelligence stores. This object converts input data into vectors of numbers, based on encoder-specific goals and configurations. Encoders can be used independently to run encodings or can be configured as part of solutions to encode text columns.") API.
3. Use the [constructor](https://servicenow-prod.fluidtopics.net/n0ITHoNNnE5DnGxbNhqWtg#ClassifictnSol-ClassificationSolution_O "Creates a classification solution.") to create a classification solution object.
4. Add the solution object to the classification solution store using the [ClassificationSolutionStore - add()](https://servicenow-prod.fluidtopics.net/qGtKN6FosUL3scH7MfLfHw#ClassificationStore-add_O "Adds a new solution object to the store and returns a unique name.") method.
5. Train the solution using the [submitTrainingJob()](https://servicenow-prod.fluidtopics.net/n0ITHoNNnE5DnGxbNhqWtg#ClassifictnSol-submitTrainingJob "Submits a training job.") method. This creates a version of the object that you can manage using the [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/AL0AXV7FLmJf60UR28zYkg#ClassificationSolutionVersionAPI "The ClassificationSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") API.
6. Get predictions using the [ClassificationSolutionVersion -- predict()](https://servicenow-prod.fluidtopics.net/AL0AXV7FLmJf60UR28zYkg#ClssfnV-predict_O_O "Gets the input data for a prediction.") method.

{#ClassificationSolutionAPI__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).

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

Creates a classification solution.
{#ClassifictnSol-ClassificationSolution_O__table_gm2_yt5_flb__entry__3}{#ClassifictnSol-ClassificationSolution_O__solution-obj-domainN-default}{#ClassifictnSol-ClassificationSolution_O__solution-obj-lang-desc}{#ClassifictnSol-ClassificationSolution_O__solution-obj-stop-desc}

| Name | Type | Description |
|-|-|-|
| config | Object | JavaScript object containing configuration properties of the solution. { "algorithmConfig": {Object}, "dataset": {Object}, "domainName": "String", "encoder": {Object}, "groupByFieldName": "String", "inputFieldNames": [Array], "label": "String", "minRowCount": "String", "predictedFieldName": "String", "processingLanguage": "String", "stopwords": [Array], "trainingFrequency": "String" } |
| config.algorithmConfig | Object | JavaScript object containing algorithm configuration properties. 'algorithmConfig' : { "algorithm": "String", "targetClassRecall": "String" } |
| config.algorithmConfig.algorithm | String | Method for encoding your solution. Possible values: * xgboost: XGBoost encoding to optimize the training. * logisticRegression: Method using the logistic regression model for categorical targets such as nominal or ordinal. {#ClassifictnSol-ClassificationSolution_O__ul_wtd_l2k_xlb} |
| config.algorithmConfig.targetClassRecall | String | Applies a class recall parameter to steer a solution's training to bias a specific class. Format is `"<ClassName:RecallValue>"` where the recall value is a number between 0 and 100 representing a percentage. For example, to set and apply this solution parameter to 90% accuracy for all records you train in the Email class, the value is set to `"Email:90"`. |
| 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.") 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.encoder | Object | Optional. Trained encoder object to assign to this solution. See [Encoder - Encoder(Object config)](https://servicenow-prod.fluidtopics.net/lD2dU3P5hPYTlVdnWNZofg#Encoder-Encoder_O "Creates an encoder."). |
| config.groupByFieldName | String | Optional. Field name by which the system groups records to build classification solutions. For usage information, see [Using group by for classification](https://www.servicenow.com/docs/access?context=using-group-by-for-classification&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US). |
| 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.minRowCount | String | Optional. Minimum number of records required in the dataset for training. Default: 10000 |
| config.predictedFieldName | String | Identifies a field to be trained for predictability. |
| config.processingLanguage | String | Optional. Processing language in two-letter ISO 639-1 language code format. Default: "en" |
| 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 {#ClassifictnSol-ClassificationSolution_O__ul_pmw_523_plb}Default: run_once |
[Table 1. Parameters]

{#ClassifictnSol-ClassificationSolution_O__table_gm2_yt5_flb}  
The following example shows how to create an object and add it to the ClassificationSolution store.

    var myData = new sn_ml.DatasetDefinition(
      { 
         'tableName' : 'incident', 
         'fieldNames' : ['category', 'short_description', 'priority'],
         'fieldDetails' : [
           {
             'name' : 'category',
             'type' : 'nominal'
           },
           {
             'name' : 'short_description',
             'type' : 'text'
           }], 
         'encodedQuery' : 'activeANYTHING'
      });

    var mySolution = new sn_ml.ClassificationSolution({
      'label': "my solution definition",
      'dataset' : myData,
      'predictedFieldName' : 'category',
      'inputFieldNames': ['short_description']
    });

    var myClassificationName = sn_ml.ClassificationSolutionStore.add(mySolution);

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

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

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

{#ClassifictnSol-cancelTrainingJob__table_bpb_k3z_llb} {#ClassifictnSol-cancelTrainingJob__table_cpb_k3z_llb__entry__2}

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

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

    var mySolution = sn_ml.ClassificationSolutionStore.get('ml_sn_global_global_classification');

    mySolution.cancelTrainingJob();

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

Gets the active
ClassificationSolutionVersion object.
{#ClassifictnSol-getActiveVersion__table_tvl_m3z_llb__entry__3}

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

{#ClassifictnSol-getActiveVersion__table_tvl_m3z_llb} {#ClassifictnSol-getActiveVersion__table_uvl_m3z_llb__entry__2}

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

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

    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_x_snc_global_global_classification');

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

Output:

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

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

Gets all versions of a classification solution.
{#ClassifictnSol-getAllVersions__table_tvl_m3z_llb__entry__3}

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

{#ClassifictnSol-getAllVersions__table_tvl_m3z_llb} {#ClassifictnSol-getAllVersions__table_uvl_m3z_llb__entry__2}

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

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

    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_x_snc_global_global_classification');

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

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

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

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

{#ClassifictnSol-getLatestVersion__table_tvl_m3z_llb} {#ClassifictnSol-getLatestVersion__table_uvl_m3z_llb__entry__2}

| Type | Description |
|-|-|
| Object | [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/AL0AXV7FLmJf60UR28zYkg#ClassificationSolutionVersionAPI "The ClassificationSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") object corresponding to the latest version of a [ClassificationSolution()](https://servicenow-prod.fluidtopics.net/n0ITHoNNnE5DnGxbNhqWtg#ClassifictnSol-ClassificationSolution_O "Creates a classification solution."). |
[Table 9. Returns]

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

    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_x_snc_global_global_classification');

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

Output:

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

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

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

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

{#ClassifictnSol-getName__table_pps_43z_llb} {#ClassifictnSol-getName__table_qps_43z_llb__entry__2}

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

{#ClassifictnSol-getName__table_qps_43z_llb}  
The following example shows how to update
ClassificationSolution
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('classification'));

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

    // update solution
    sn_ml.ClassificationSolutionStore.update('ml_x_snc_global_global_my_solution_definition_4', myClassification);

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

Output:

    Solution Name: ml_x_snc_global_global_my_solution_definition_4

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

Gets solution object properties.
{#ClassifictnSol-getProperties__table_pps_43z_llb__entry__3}

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

{#ClassifictnSol-getProperties__table_pps_43z_llb} {#ClassifictnSol-getProperties__table_qps_43z_llb__entry__2}{#ClassifictnSol-getProperties__classification-obj-group-desc}

| Type | Description |
|-|-|
| Object | Contents of the Dataset and [ClassificationSolution()](https://servicenow-prod.fluidtopics.net/n0ITHoNNnE5DnGxbNhqWtg#ClassifictnSol-ClassificationSolution_O "Creates a classification solution.") object details in the [ClassificationSolutionStore](https://servicenow-prod.fluidtopics.net/qGtKN6FosUL3scH7MfLfHw#ClassificationSolutionStoreAPI "Enables storing and retrieving solutions."). { "algorithmConfig": { "algorithm": "String", "targetClassRecall": "String" }, "datasetProperties": {Object}, "domainName": "String", "encoder": {Object}, "groupByFieldName": "String", "inputFieldNames": [Array], "label": "String", "name": "String", "predictedFieldName": "String", "processingLanguage": "String", "scope": "String", "stopwords": [Array], "trainingFrequency": "String" } |
| \<Object\>.algorithmConfig | Method for encoding the solution. Data type: Object. |
| \<Object\>.algorithmConfig.algorithm | Name of the encoding algorithm for training this solution. Possible values: * xgboost: XGBoost encoding to optimize the training. * logisticRegression: Method using the logistic regression model for categorical targets such as nominal or ordinal. {#ClassifictnSol-getProperties__ul_wtd_l2k_xlb} Data type: String. |
| \<Object\>.algorithmConfig.targetClassRecall | Class recall parameter to steer a solution's training to bias a specific class. The recall value is a number between 0 and 100 representing a percentage. Data type: String |
| \<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\>.encoder | Encoder object assigned to this solution. See [Encoder - Encoder(Object config)](https://servicenow-prod.fluidtopics.net/lD2dU3P5hPYTlVdnWNZofg#Encoder-Encoder_O "Creates an encoder."). Data type: Object. |
| \<Object\>.groupByFieldName | Field name by which the system groups records to build classification solutions. 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\>.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 {#ClassifictnSol-getProperties__ul_pmw_523_plb}Default: run_once Data type: String. |
[Table 13. Returns]

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

    var mySolution = sn_ml.ClassificationSolutionStore.get('ml_sn_global_global_classification_solution');

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

Output:

    *** Script: {
      "datasetProperties": {
        "tableName": "incident",
        "fieldNames": [
          "category",
          "short_description",
          "priority",
          "assignment_group.name"
        ],
        "fieldDetails": [
          {
            "name": "category",
            "type": "nominal"
          },
          {
            "name": "short_description",
            "type": "text"
          }
        ]
      },
      "domainName": "global",
      "inputFieldNames": [
        "short_description"
      ],
      "label": "my solution definition",
      "name": "ml_x_snc_global_global_my_solution_definition_26",
      "predictedFieldName": "category",
      "processingLanguage": "en",
      "scope": "global",
      "stopwords": [
        "Default English Stopwords"
      ],
      "trainingFrequency": "run_once"
    }

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

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

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

{#ClassifictnSol-getVersion_S__table_pps_43z_llb} {#ClassifictnSol-getVersion_S__table_qps_43z_llb__entry__2}

| Type | Description |
|-|-|
| Object | Specified version of the [ClassificationSolution()](https://servicenow-prod.fluidtopics.net/n0ITHoNNnE5DnGxbNhqWtg#ClassifictnSol-ClassificationSolution_O "Creates a classification solution.") object on which you can call [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/AL0AXV7FLmJf60UR28zYkg#ClassificationSolutionVersionAPI "The ClassificationSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") API methods. |
[Table 15. Returns]

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

    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_x_snc_global_global_classification');

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

Output:

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

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

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

| Name | Type | Description |
|-|-|-|
| version | String | Name of the [ClassificationSolution()](https://servicenow-prod.fluidtopics.net/n0ITHoNNnE5DnGxbNhqWtg#ClassifictnSol-ClassificationSolution_O "Creates a classification solution.") object version to activate. Activating this version deactivates any other version. |
[Table 16. Parameters]

{#ClassifictnSol-setActiveVersion_S__table_pps_43z_llb} {#ClassifictnSol-setActiveVersion_S__table_qps_43z_llb__entry__2}

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

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

    sn_ml.ClassificationSolution.setActiveVersion("ml_incident_categorization");

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

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

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

{#ClassifictnSol-submitTrainingJob__table_xmd_33z_llb} {#ClassifictnSol-submitTrainingJob__table_ymd_33z_llb__entry__2}

| Type | Description |
|-|-|
| Object | [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/AL0AXV7FLmJf60UR28zYkg#ClassificationSolutionVersionAPI "The ClassificationSolutionVersion API is a scriptable object used in Predictive Intelligence stores.") object corresponding to the [ClassificationSolution](https://servicenow-prod.fluidtopics.net/n0ITHoNNnE5DnGxbNhqWtg#ClassifictnSol-ClassificationSolution_O "Creates a classification solution.") being trained. |
[Table 19. Returns]

{#ClassifictnSol-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.{#ClassifictnSol-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.ClassificationSolution({

      '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.ClassificationSolutionStore.add(mySolution);

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


