---
sourceDocument: Xanadu API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ClassificationSolution - グローバル

# ClassificationSolution - グローバル {#ariaid-title1}

* リリースバージョン: Xanadu
* 
* 更新日 2024年08月01日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：22分

ClassificationSolution API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。

この API には 予測インテリジェンス プラグイン (com.glide.platform_ml) が必要です。この API は `sn_ml` 名前空間内で提供されます。  
ソリューションのセットアップからトレーニングまでのフローは次のとおりです。

1. [DatasetDefinition](https://servicenow-prod.fluidtopics.net/kERREiAlGZUL679rFNdNtw#DatasetDefinitionAPI "DatasetDefinition API は、ML トレーニングアルゴリズムの入力として使用する、テーブル名、列、および行の選択基準を含むレコードのセット。データセットには実際のデータは含まれていません。") API を使用してデータセットを作成します。
2. オプション。[Encoder](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#EncoderAPI "Encoder API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトを提供します。このオブジェクトは、Encoder 固有の目標と構成に基づいて、入力データを数値のベクトルに変換します。エンコーダーは、エンコーディングを実行するために個別に使用することも、テキスト列をエンコードするソリューションの一部として構成することもできます。") API を使用してエンコーダーを構築します。
3. [コンストラクタ―](https://servicenow-prod.fluidtopics.net/v~WYb2DG8hEwgSix0LK4Uw#ClassifictnSol-ClassificationSolution_O "分類のソリューションを作成します。") を使用して、分類ソリューションオブジェクトを作成します。
4. [ClassificationSolutionStore - add()](https://servicenow-prod.fluidtopics.net/YK7MLChx4~Tr0VoFVG4WSA#ClassificationStore-add_O "新しいソリューション オブジェクトをストアに追加し、一意の名前を返します。") メソッドを使用して、ソリューションオブジェクトを分類ソリューションストアに追加します。
5. [submitTrainingJob()](https://servicenow-prod.fluidtopics.net/v~WYb2DG8hEwgSix0LK4Uw#ClassifictnSol-submitTrainingJob "トレーニングジョブを送信します。") メソッドを使用してソリューションをトレーニングします。これにより、[ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/MVQBn~5kH_J_tOR6~uvJ0A#ClassificationSolutionVersionAPI "ClassificationSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") API を使用して管理できるオブジェクトのバージョンが作成されます。
6. [ClassificationSolutionVersion --predict()](https://servicenow-prod.fluidtopics.net/MVQBn~5kH_J_tOR6~uvJ0A#ClssfnV-predict_O_O "予測の入力データを取得します。") メソッドを使用して予測を取得します。

{#ClassificationSolutionAPI__ol_mmm_n1c_dmb}  
注:  
この API は全権限で実行します。ユーザーのアクセスを制限するには、スクリプトにアクセス制御メカニズムを含めます。

使用上のガイドラインについては、「 [ML API の使用](https://www.servicenow.com/docs/access?context=using-ml-apis&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US)」を参照してください。

## ClassificationSolution - ClassificationSolution(オブジェクト config) {#ariaid-title2}

分類のソリューションを作成します。
{#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}

| 名前 | タイプ | 説明 |
|-|-|-|
| config | オブジェクト | の構成プロパティを含む JavaScript オブジェクト ソリューション。 { "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 | オブジェクト | アルゴリズム設定プロパティを含む JavaScript オブジェクト。 'algorithmConfig' : { "algorithm": "String", "targetClassRecall": "String" } |
| config.algorithmConfig.algorithm | 文字列 | ソリューションをエンコードする方法。 可能な値： * xgboost：トレーニングを最適化するための XGBoost エンコーディング。 * logisticRegression：名目値や序数などのカテゴリターゲットにロジスティック回帰モデルを使用する方法。 {#ClassifictnSol-ClassificationSolution_O__ul_wtd_l2k_xlb} |
| config.algorithmConfig.targetClassRecall | 文字列 | クラスリコールパラメーターを適用して、特定のクラスをバイアスするソリューションのトレーニングを操作します。形式は `"<ClassName:RecallValue>"` です。RecallValue はパーセンテージを表す 0 〜 100 の数値です。例えば、Email クラスでトレーニングするすべてのレコードについて、このソリューションパラメーターを 90% の精度に設定して適用するには、値を `"Email:90"`に設定します。 |
| config.dataset | オブジェクト | [DatasetDefinition](https://servicenow-prod.fluidtopics.net/kERREiAlGZUL679rFNdNtw#DatasetDefinitionAPI "DatasetDefinition API は、ML トレーニングアルゴリズムの入力として使用する、テーブル名、列、および行の選択基準を含むレコードのセット。データセットには実際のデータは含まれていません。") 名。 |
| config.domainName | 文字列 | オプション。このデータセットに関連付けられたドメイン名。[「ドメインセパレーション」および予測インテリジェンス](https://www.servicenow.com/docs/access?context=domain-separation-predictive-intelligence&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US)「」を参照してください。 デフォルト：現在のドメイン。例：`"global"`。 |
| config.encoder | オブジェクト | オプション。このソリューションに割り当てるトレーニング済みのエンコーダーオブジェクト。「[Encoder - Encoder(オブジェクト config)](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#Encoder-Encoder_O "Encoder を作成します。")」を参照してください。 |
| config.groupByFieldName | 文字列 | オプション。レコードをグループ化して分類ソリューションを構築するために使用するフィールド名。 使用方法については、「 [分類のためのグループ化の使用](https://www.servicenow.com/docs/access?context=using-group-by-for-classification&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US)」を参照してください。 |
| config.inputFieldNames | アレイ | 文字列としての入力フィールド名のリスト。モデルは、次のフィールドを使用して予測を行います。 |
| config.label | 文字列 | 予測タスクを識別します。 |
| config.minRowCount | 文字列 | オプション。トレーニング用のデータセットに必要なレコードの最小数。 デフォルト：10000 |
| config.predictedFieldName | 文字列 | 予測可能性についてトレーニングするフィールドを識別します。 |
| config.processingLanguage | 文字列 | オプション。2 文字の ISO 639-1 言語コード形式の処理言語。 デフォルト値：「en」 |
| config.stopwords | アレイ | オプション。language プロパティ設定に基づいて自動的に生成される文字列のプリセットリスト。詳しくは、 [カスタムストップワードリストの作成](https://www.servicenow.com/docs/access?context=create-custom-stopwords-list&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US)を参照してください。 デフォルト：英語のストップワード |
| config.trainingFrequency | 文字列 | モデルを再トレーニングする頻度。 可能な値： * every_30_days * every_60_days * every_90_days * every_120_days * every_180_days * run_once {#ClassifictnSol-ClassificationSolution_O__ul_pmw_523_plb}デフォルト：run_once |
[表 : 1. パラメーター]

{#ClassifictnSol-ClassificationSolution_O__table_gm2_yt5_flb}  
次の例は、オブジェクトを作成して ClassificationSolution ストア。

    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}

トレーニングのために送信されたソリューションオブジェクトのジョブをキャンセルします。
{#ClassifictnSol-cancelTrainingJob__table_bpb_k3z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 2. パラメーター]

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

| タイプ | 説明 |
|-|-|
| なし |   |
[表 : 3. 返される内容]

{#ClassifictnSol-cancelTrainingJob__table_cpb_k3z_llb}  
次の例は、既存のトレーニングジョブをキャンセルする方法を示しています。

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

    mySolution.cancelTrainingJob();

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

アクティブな ClassificationSolutionVersion オブジェクト。
{#ClassifictnSol-getActiveVersion__table_tvl_m3z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 4. パラメーター]

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

| タイプ | 説明 |
|-|-|
| オブジェクト | アクティブな [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/MVQBn~5kH_J_tOR6~uvJ0A#ClassificationSolutionVersionAPI "ClassificationSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") オブジェクト。 |
[表 : 5. 返される内容]

{#ClassifictnSol-getActiveVersion__table_uvl_m3z_llb}  
次の例は、 ClassificationSolution ストアからアクティブなバージョンを取得し、そのトレーニング状態を返す

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

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

出力：

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

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

分類のソリューションの のすべてのバージョンを取得します。
{#ClassifictnSol-getAllVersions__table_tvl_m3z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 6. パラメーター]

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

| タイプ | 説明 |
|-|-|
| アレイ | ソリューションオブジェクトの既存のバージョン。関連項目 [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/MVQBn~5kH_J_tOR6~uvJ0A#ClassificationSolutionVersionAPI "ClassificationSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") API。 |
[表 : 7. 返される内容]

{#ClassifictnSol-getAllVersions__table_uvl_m3z_llb}  
次の例は、すべての ClassificationSolution バージョンオブジェクトを取得し、それらに対して getVersionNumber() および getStatus() ソリューションバージョンメソッドを呼び出す方法を示しています。

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

出力：

    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}

ソリューション の最新バージョンを取得します。
{#ClassifictnSol-getLatestVersion__table_tvl_m3z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 8. パラメーター]

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

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/MVQBn~5kH_J_tOR6~uvJ0A#ClassificationSolutionVersionAPI "ClassificationSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") の最新バージョンに対応するオブジェクト[ClassificationSolution()](https://servicenow-prod.fluidtopics.net/v~WYb2DG8hEwgSix0LK4Uw#ClassifictnSol-ClassificationSolution_O "分類のソリューションを作成します。")です。 |
[表 : 9. 返される内容]

{#ClassifictnSol-getLatestVersion__table_uvl_m3z_llb}  
次の例は、ソリューションの最新バージョンを取得して、トレーニングのステータスを返す方法を示しています。{#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));

出力：

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

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

ストアの操作に使用するオブジェクトの名前を取得します。
{#ClassifictnSol-getName__table_pps_43z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 10. パラメーター]

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

| タイプ | 説明 |
|-|-|
| 文字列 | ソリューションオブジェクトの名前。 |
[表 : 11. 返される内容]

{#ClassifictnSol-getName__table_qps_43z_llb}  
次の例は、 ClassificationSolution データセット情報を更新し、オブジェクトの名前を出力

    // 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());

出力：

    Solution Name: ml_x_snc_global_global_my_solution_definition_4

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

ソリューションオブジェクトプロパティを取得します。
{#ClassifictnSol-getProperties__table_pps_43z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 12. パラメーター]

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

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClassificationSolutionStore](https://servicenow-prod.fluidtopics.net/YK7MLChx4~Tr0VoFVG4WSA#ClassificationSolutionStoreAPI "ソリューション の保存と取得を有効にします 。") のデータセットのコンテンツと [ClassificationSolution()](https://servicenow-prod.fluidtopics.net/v~WYb2DG8hEwgSix0LK4Uw#ClassifictnSol-ClassificationSolution_O "分類のソリューションを作成します。") オブジェクトの詳細。 { "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 | ソリューションをエンコードするメソッド。 データタイプ：オブジェクト |
| \<Object\>.algorithmConfig.algorithm | このソリューションをトレーニングするためのエンコーディングアルゴリズムの名前。 可能な値： * xgboost：トレーニングを最適化するための XGBoost エンコーディング。 * logisticRegression：名目値や序数などのカテゴリターゲットにロジスティック回帰モデルを使用する方法。 {#ClassifictnSol-getProperties__ul_wtd_l2k_xlb} データタイプ：文字列。 |
| \<Object\>.algorithmConfig.targetClassRecall | 特定のクラスをバイアスするソリューションのトレーニングを操作するためのクラスリコールパラメーター。リコール値は、パーセンテージを表す 0 〜 100 の数値です。 データタイプ：文字列 |
| \<Object\>.datasetProperties | ソリューションに関連付けられた [DatasetDefinition()](https://servicenow-prod.fluidtopics.net/kERREiAlGZUL679rFNdNtw#DDef-DatasetDefinition_O "DatasetDefinition クラスのインスタンスを作成し、テーブル名、フィールド、およびクエリーでデータセットを定義できるようにします。") オブジェクトのプロパティを一覧表示します。 { "encodedQuery": "String", "fieldDetails": [Array], "fieldNames": [Array], "tableName": "String" } データタイプ：オブジェクト |
| \<Object\>.datasetProperties.tableName | データセットのテーブルの名前。例：`"tableName" : "Incident"` データタイプ：文字列。 |
| \<Object\>.datasetProperties.fieldNames | 指定されたテーブルからの文字列としてのフィールド名のリスト。例：`"fieldNames" : ["short_description", "priority"]` データタイプ：アレイ。 |
| \<Object\>.datasetProperties.fieldNames.fieldDetails | フィールドプロパティを指定する JavaScript オブジェクトのリスト。 [ { "name": "String", "type": "String" } ] データタイプ：アレイ。 |
| \<Object\>.datasetProperties.fieldNames.fieldDetails.\<object\>.name | このデータセットを制限する情報のタイプを定義するフィールドの名前。 データタイプ：文字列。 |
| \<Object\>.datasetProperties.fieldDetails.\<object\>.type | 機械学習フィールドタイプ。 データタイプ：文字列。 |
| \<Object\>.datasetProperties.fieldDetails.encodedQuery | 標準の Glide 形式のエンコードされたクエリ文字列。「 [エンコードされたクエリ文字列](https://www.servicenow.com/docs/access?context=c_EncodedQueryStrings&version=xanadu&pubname=xanadu-platform-user-interface&ft:locale=en-US)」を参照してください。 データタイプ：文字列。 |
| \<Object\>.domainName | このデータセットに関連付けられたドメイン名。[「ドメインセパレーション」および予測インテリジェンス](https://www.servicenow.com/docs/access?context=domain-separation-predictive-intelligence&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US)「」を参照してください。 データタイプ：文字列。 |
| \<Object\>.encoder | このソリューションに割り当てられるエンコーダーオブジェクト。「[Encoder - Encoder(オブジェクト config)](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#Encoder-Encoder_O "Encoder を作成します。")」を参照してください。 データタイプ：オブジェクト |
| \<Object\>.groupByFieldName | レコードをグループ化して分類ソリューションを構築するために使用するフィールド名。 データタイプ：文字列 |
| \<Object\>.inputFieldNames | 文字列としての入力フィールド名のリスト。モデルは、次のフィールドを使用して予測を行います。 データタイプ：文字列。 |
| \<Object\>.label | 予測タスクを識別します。 { "label": "my first prediction" } データタイプ：文字列。 |
| \<Object\>.name | システムによって割り当てられた名前。 データタイプ：文字列。 |
| \<Object\>.predictedFieldName | 予測可能性についてトレーニングするフィールドを識別します。 データタイプ：文字列。 |
| \<Object\>.processingLanguage | 2 文字の ISO 639-1 言語コード形式の処理言語。 データタイプ：文字列。 |
| \<Object\>.scope | オブジェクトスコープ。現在、有効な値は `global` のみです。 データタイプ：文字列 |
| \<Object\>.stopwords | オプション。language プロパティ設定に基づいて自動的に生成される文字列のプリセットリスト。詳しくは、 [カスタムストップワードリストの作成](https://www.servicenow.com/docs/access?context=create-custom-stopwords-list&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US)を参照してください。 データタイプ：アレイ。 |
| \<Object\>.trainingFrequency | モデルを再トレーニングする頻度。 可能な値： * every_30_days * every_60_days * every_90_days * every_120_days * every_180_days * run_once {#ClassifictnSol-getProperties__ul_pmw_523_plb}デフォルト：run_once データタイプ：文字列。 |
[表 : 13. 返される内容]

{#ClassifictnSol-getProperties__table_qps_43z_llb}  
次の例では、ストア内のソリューションオブジェクトのプロパティを取得します。{#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));

出力：

    *** 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(文字列 version) {#ariaid-title9}

指定されたバージョン番号を使用します。ソリューションを取得します。
{#ClassifictnSol-getVersion_S__table_pps_43z_llb__entry__3}{#ClassifictnSol-getVersion_S__mlsol-gerversion-returns-other}

| 名前 | タイプ | 説明 |
|-|-|-|
| version | 文字列 | ソリューションの既存のバージョン番号。 |
[表 : 14. パラメーター]

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

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/MVQBn~5kH_J_tOR6~uvJ0A#ClassificationSolutionVersionAPI "ClassificationSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") API メソッドを呼び出すことができる [ClassificationSolution()](https://servicenow-prod.fluidtopics.net/v~WYb2DG8hEwgSix0LK4Uw#ClassifictnSol-ClassificationSolution_O "分類のソリューションを作成します。") オブジェクトの指定されたバージョン。 |
[表 : 15. 返される内容]

{#ClassifictnSol-getVersion_S__table_qps_43z_llb}  
次の例は、バージョン番号別にソリューションのトレーニングステータスを取得する方法を示しています。{#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));

出力：

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

## ClassificationSolution - setActiveVersion(文字列 version) {#ariaid-title10}

ストア内の指定されたバージョンのソリューションをアクティブ化します。
{#ClassifictnSol-setActiveVersion_S__table_pps_43z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| version | 文字列 | アクティブ化する [ClassificationSolution()](https://servicenow-prod.fluidtopics.net/v~WYb2DG8hEwgSix0LK4Uw#ClassifictnSol-ClassificationSolution_O "分類のソリューションを作成します。") オブジェクトバージョンの名前。 このバージョンをアクティブ化すると、他のバージョンが非アクティブになります。 |
[表 : 16. パラメーター]

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

| タイプ | 説明 |
|-|-|
| なし |   |
[表 : 17. 返される内容]

{#ClassifictnSol-setActiveVersion_S__table_qps_43z_llb}  
次の例は、ストア内のソリューションバージョンを有効にする方法を示しています。{#ClassifictnSol-setActiveVersion_S__mlsol-setActive-example2}

    sn_ml.ClassificationSolution.setActiveVersion("ml_incident_categorization");

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

トレーニングジョブを送信します。
注:  
このメソッドを実行する前に、まず [ClassificationSolutionStore - add()](https://servicenow-prod.fluidtopics.net/YK7MLChx4~Tr0VoFVG4WSA#ClassificationStore-add_O "新しいソリューション オブジェクトをストアに追加し、一意の名前を返します。") メソッドを使用してストアにソリューションを追加する必要があります。
{#ClassifictnSol-submitTrainingJob__table_xmd_33z_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| なし |   |   |
[表 : 18. パラメーター]

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

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClassificationSolutionVersion](https://servicenow-prod.fluidtopics.net/MVQBn~5kH_J_tOR6~uvJ0A#ClassificationSolutionVersionAPI "ClassificationSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") に対応するオブジェクト [ClassificationSolution](https://servicenow-prod.fluidtopics.net/v~WYb2DG8hEwgSix0LK4Uw#ClassifictnSol-ClassificationSolution_O "分類のソリューションを作成します。") トレーニング対象 |
[表 : 19. 返される内容]

{#ClassifictnSol-submitTrainingJob__table_ymd_33z_llb}  
次の例は、データセットを作成してソリューションに適用し、ソリューション をストアに追加して、トレーニングジョブを送信する方法を示しています。{#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();


