---
sourceDocument: オーストラリア API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/api-reference

 Release :

    - australia

ft:locale :

    - ja-JP

ft:publication_title :

    - オーストラリア API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ClassificationSolutionVersion - グローバル

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

* リリースバージョン: Australia
* 
* 更新日 2026年03月12日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：28分

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

この API には 予測インテリジェンス プラグイン (com.glide.platform_ml) が必要で、 `sn_ml` 名前空間内で提供されます。

この API は、[ClassificationSolution ストア](https://servicenow-prod.fluidtopics.net/~g6B1QCIhomhdsZmsVONCQ#ClassificationSolutionStoreAPI "ソリューション の保存と取得を可能にします 。")内の [ClassificationSolution API](https://servicenow-prod.fluidtopics.net/0GJ7S2v_EH30a~RFaORd~g#ClassificationSolutionAPI "ClassificationSolution API は、予測インテリジェンスストアで使用されるスクリプト可能なオブジェクトです。") オブジェクトに基づくソリューションバージョンを操作するために使用されます。

ソリューション定義をトレーニングするたびに、ソリューションバージョンが作成されます。ほとんどのバージョンは、スケジュールされたソリューショントレーニング中に作成されます。  
この API のメソッドには、次の [ClassificationSolution - グローバル](https://servicenow-prod.fluidtopics.net/0GJ7S2v_EH30a~RFaORd~g#ClassificationSolutionAPI "ClassificationSolution API は、予測インテリジェンスストアで使用されるスクリプト可能なオブジェクトです。") メソッドを使用してアクセスできます。

* [getActiveVersion()](https://servicenow-prod.fluidtopics.net/0GJ7S2v_EH30a~RFaORd~g#ClassifictnSol-getActiveVersion "アクティブを取得します ClassificationSolutionVersion オブジェクト。")
* [getAllVersions()](https://servicenow-prod.fluidtopics.net/0GJ7S2v_EH30a~RFaORd~g#ClassifictnSol-getAllVersions "のすべてのバージョンを取得します 分類ソリューション。")
* [getLatestVersion()](https://servicenow-prod.fluidtopics.net/0GJ7S2v_EH30a~RFaORd~g#ClassifictnSol-getLatestVersion "の最新バージョンを取得します 解決策。")
* [getVersion()](https://servicenow-prod.fluidtopics.net/0GJ7S2v_EH30a~RFaORd~g#ClassifictnSol-getVersion_S "ソリューションを取得します 指定されたバージョン番号で。")
{#ClassificationSolutionVersionAPI__ul_ycl_fzf_tlb}

## ClassificationSolutionVersion - getPredictionPerformance (オブジェクトオプション) {#ariaid-title2}

ソリューションの精度と範囲を計算します。
このメソッドを使用するには、最初に setPredictionSettings() メソッドを使用して設定を作成する必要があります。
{#ClssfnV-getPredictionPerformance_O__table_gby_x2w_plb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| オプション | オブジェクト | 日付のスパン内で取得するメトリクスを選択します。詳しくは、 [ターゲット・メトリックの構成](https://www.servicenow.com/docs/access?context=configuring-target-metrics-trained-classification-solution&version=australia&pubname=australia-intelligent-experiences&ft:locale=en-US)を参照してください。 { "fromDate": "String", "metricName": "String", "toDate": "String" } |
| options.fromDate | 文字列 | オプション。システム日時形式でメトリクスを取得する開始日。 |
| options.metricName | 文字列 | メトリクスの名前。 有効な値： * precision * coverage {#ClssfnV-getPredictionPerformance_O__ul_ncd_ldx_plb} |
| options.toDate | 文字列 | オプション。メトリクスの取得が開始される終了日。 形式:システムの日時形式。 |
[表 : 1. パラメーター]

{#ClssfnV-getPredictionPerformance_O__table_gby_x2w_plb} {#ClssfnV-getPredictionPerformance_O__table_hby_x2w_plb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | 入力メトリクスの結果を含む解析可能な JavaScript オブジェクト。 { "metricName" : "String", "metricValue" : "String", "numberOfPredictionsConsidered" : "String" } |
| Object.metricName | 入力として選択されたメトリクスの名前。 データタイプ：文字列 |
| Object.metricValue | 選択したメトリクスの値。 データタイプ：文字列 |
| Object.numberOfRecordsConsidered | 計算対象として考慮される予測結果 \[ml_predictor_results\] テーブル内のレコードの数。 データタイプ：文字列 |
[表 : 2. 返される内容]

{#ClssfnV-getPredictionPerformance_O__table_hby_x2w_plb}  
次の例は、ソリューションのアクティブなバージョンから精度値を取得する方法を示しています。

    // Get precision value
    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_incident_categorization');

    gs.print(JSON.stringify(JSON.parse(mlSolution.getActiveVersion().getPredictionPerformance({"metricName": "precision"})), null, 2));

出力：

    {
      "metricName": "precision",
      "metricValue": "70.10",
      "numberOfPredictionsConsidered": "10"
    }

## ClassificationSolutionVersion:getPredictionSettings() {#ariaid-title3}

ML ソリューション \[ml_solution\] テーブルから推定精度、推定カバー範囲、推定再現率値を、クラス信頼性 \[ml_class\] テーブルからレコードを取得します。
{#ClssfnV-getPredictionSettings__table_eq3_xbw_plb__entry__3}

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

{#ClssfnV-getPredictionSettings__table_eq3_xbw_plb} {#ClssfnV-getPredictionSettings__table_wph_2dw_plb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | 各クラスの予測設定を返します。データには、ML ソリューション \[ml_solution\] テーブルのトレーニング済みモデルに含まれるすべてのクラスの精度、範囲、再現率、および分布値が含まれます。詳細については、「 [予測モデルのコンポーネント」](https://www.servicenow.com/docs/access?context=predictive-intelligence&version=australia&pubname=australia-intelligent-experiences&ft:locale=en-US)を参照してください。 { "<class name>": {Object} } |
| \<Object\>.\<class name\> | クラス信頼性 \[ml_class\] テーブルのトレーニング統計データ。詳しくは、 [ターゲット・メトリックの構成](https://www.servicenow.com/docs/access?context=configuring-target-metrics-trained-classification-solution&version=australia&pubname=australia-intelligent-experiences&ft:locale=en-US)を参照してください。 データタイプ: オブジェクト { "precision": "String", "coverage": "String", "recall": "String" } |
| \<Object\>.\<class name\>.precision | このクラスの推定ソリューション精度メトリクス。 データタイプ:文字列 (数値) |
| \<Object\>.\<class name\>.coverage | このクラスの推定ソリューション カバレッジメトリクス。 データタイプ:文字列 (数値) |
| \<Object\>.\<class name\>.recall | このクラスの推定ソリューション再現率メトリクス。 データタイプ:文字列 (数値) |
[表 : 4. 返される内容]

{#ClssfnV-getPredictionSettings__table_wph_2dw_plb}  
次の例は、アクティブなソリューションバージョンの予測設定を取得する方法を示しています。

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

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

出力：

    {
      "solutionSettings": {
        "precision": "61.69",
        "coverage": "66.75",
        "recall": "57.54"
      },
      "classSettings": {
        "Approvals": {
          "precision": "100",
          "coverage": "0",
          "recall": "0"
        },
        "Authentication": {
          "precision": "38.71",
          "coverage": "98.44",
          "recall": "56.25"
        },
        "Automation": {
          "precision": "100",
          "coverage": "0",
          "recall": "0"
        }, ...

## ClassificationSolutionVersion:getProperties() {#ariaid-title4}

ソリューションオブジェクトプロパティを取得します およびバージョン番号。
{#ClssfnV-getProperties__table_d2m_zwz_4lb__entry__3}

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

{#ClssfnV-getProperties__table_d2m_zwz_4lb} {#ClssfnV-getProperties__table_e2m_zwz_4lb__entry__2}{#ClssfnV-getProperties__classification-obj-group-desc}

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

{#ClssfnV-getProperties__table_e2m_zwz_4lb}  
次の例では、ストア内のアクティブなオブジェクトバージョンのプロパティを取得します。

    // Get properties
    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_incident_categorization');

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

出力：

    *** Script: {
      "datasetProperties": {
        "encodedQuery": "activeANYTHING^EQ",
        "fieldNames": [
          "short_description",
          "category"
        ],
        "tableName": "incident"
      },
      "domainName": "global",
      "inputFieldNames": [
        "short_description"
      ],
      "isActive": "true",
      "label": "Incident Categorization_Trainer",
      "name": "ml_incident_categorization",
      "predictedFieldName": "category",
      "processingLanguage": "en",
      "stopwords": [
        "Default English Stopwords"
      ],
      "versionNumber": "1"
    }

## ClassificationSolutionVersion:getStatus(ブール値 includeDetails) {#ariaid-title5}

トレーニング完了ステータスを取得します。
{#ClssfnV-getStatus_B__table_xfh_vbw_plb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| includeDetails | ブーリアン | ステータスを details にするかどうかを示すフラグ。 有効な値： * true:追加の詳細を返します。 * false:追加の詳細を返しません。 {#ClssfnV-getStatus_B__ul_n33_ckw_plb} デフォルト値：False |
[表 : 7. パラメーター]

{#ClssfnV-getStatus_B__table_xfh_vbw_plb} {#ClssfnV-getStatus_B__table_yfh_vbw_plb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | のトレーニングステータス情報を含む JavaScript オブジェクト[ClassificationSolution](https://servicenow-prod.fluidtopics.net/0GJ7S2v_EH30a~RFaORd~g#ClassificationSolutionAPI "ClassificationSolution API は、予測インテリジェンスストアで使用されるスクリプト可能なオブジェクトです。") オブジェクト。 { "state": "String", "percentComplete": "Number as a String", "hasJobEnded": "Boolean value as a String", "details": {Object} } |
| \<Object\>。state | トレーニング完了ステータス。トレーニングジョブがターミナルステータスに達しても、ジョブはそのステータスを終了しません。ステータスが \[ターミナル\] の場合、 hasJobEnded プロパティは `true` に設定されます。 可能な値： * fetching_files_for_training * preparing_data * 再試行 * solution_cancelled (端末) * solution_complete (ターミナル) * solution_error (端末) * solution_incomplete * training_request_received * training_request_timed_out (ターミナル) * training_solution * uploading_solution * waiting_for_training {#ClssfnV-getStatus_B__ul_a5q_gh4_vlb} データタイプ：文字列 |
| \<Object\>.hasJobEnded | トレーニングが完了したかどうかを示すフラグ。 有効な値： * true:トレーニングが完了しました。 * false:トレーニングが不完全です。 {#ClssfnV-getStatus_B__ul_icy_zjx_rlb} データタイプ:文字列としてのブール値 |
| \<Object\>.percentComplete | トレーニング完了率。完了率が 100 未満の場合、ジョブはターミナル状態である可能性があります。たとえば、トレーニングがタイムアウトした場合などです。 データタイプ:文字列としての数値 範囲:0〜100 |
| \<Object\>.details | 追加のトレーニング詳細のリストを含むオブジェクト。 データタイプ: オブジェクト |
[表 : 8. 返される内容]

{#ClssfnV-getStatus_B__table_yfh_vbw_plb}  
次の例は、トレーニングが完了した正常な結果を示しています。

    // Get status
    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_incident_categorization');

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

出力：

    {
     "state":"solution_complete",
     "percentComplete":"100",
     "hasJobEnded":"true",
     "details":{"stepLabel":"Solution Complete"} // This information is only returned if getStatus(true);
    }

次の例は、トレーニング完了の失敗の結果を示しています。

    // Get status
    var solutionName = 'ml_x_snc_global_global_classification_solution';
    var mlSolution = sn_ml.ClassificationSolutionStore.get(solutionName);
    var trainingStatus = mlSolution.getLatestVersion().getStatus();

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

出力：

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

## ClassificationSolutionVersion - getTrainingStatistics() {#ariaid-title6}

指定されたソリューションのすべてのトレーニング統計情報を取得します。
{#ClssfnV-getTrainingStatistics__table_vph_2dw_plb__entry__3}

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

{#ClssfnV-getTrainingStatistics__table_vph_2dw_plb} {#ClssfnV-getTrainingStatistics__table_wph_2dw_plb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | トレーニングに含まれる各クラスの統計情報と、トレーニングから除外された各クラスの値を含む JavaScript オブジェクト。詳細については、「 [予測モデルのコンポーネント」](https://www.servicenow.com/docs/access?context=predictive-intelligence&version=australia&pubname=australia-intelligent-experiences&ft:locale=en-US)を参照してください。 { "includedClasses": {Object}, "excludedClasses": {Object} } |
| \<Object\>.includedClasses | トレーニング済みモデルの各クラスの精度、範囲、再現率、および分布値を含むオブジェクト。 データタイプ: オブジェクト "includedClasses": { "<class name>": { "distribution": "String", "statistics": [Array] }, |
| \<Object\>.includedClasses.\<class name\>.distribution | このクラスの結果確率分布の値。 データタイプ：文字列 |
| \<Object\>.includedClasses.\<class name\>.statistics | トレーニング統計データを提供するオブジェクトのリスト。詳しくは、 [ターゲット・メトリックの構成](https://www.servicenow.com/docs/access?context=configuring-target-metrics-trained-classification-solution&version=australia&pubname=australia-intelligent-experiences&ft:locale=en-US)を参照してください。 データタイプ：オブジェクトのアレイ [ { "coverage": "String", "precision": "String", "recall": "String", "selected": "String" } ] |
| \<Object\>.includedClasses.\<class name\>.statistics.coverage | このクラスの推定ソリューション カバレッジメトリクス。 データタイプ:文字列 (数値) |
| \<Object\>.includedClasses.\<class name\>.statistics.precision | このクラスの推定ソリューション精度メトリクス。 データタイプ:文字列 (数値) |
| \<Object\>.includedClasses.\<class name\>.statistics.recall | このクラスの推定ソリューション再現率メトリクス。 データタイプ:文字列 (数値) |
| \<Object\>.includedClasses.\<class name\>.statistics.selected | このクラスにソリューショントレーニングに含まれるレコードが含まれているかどうかを示すフラグ。 有効な値： * true:このクラスには、ソリューションのトレーニング用に選択されたレコードが含まれます。 * false:このクラスはトレーニングから除外されます。 {#ClssfnV-getTrainingStatistics__ul_sht_4cx_plb} データタイプ:文字列 (ブール値) デフォルト値：false |
| \<Object\>.excludedClasses | トレーニングから除外されたすべてのクラスの分布と行数。 データタイプ: オブジェクト "excludedClasses": { "<class name>": { "distribution": "0.11", "rowCount": "9" } |
| \<Object\>.excludedClasses.\<class name\>.distribution | このクラスの結果確率分布の値。 データタイプ：文字列 |
| \<Object\>.excludedClasses.\<class name\>.rowCount | トレーニングから除外された行の数。 データタイプ:文字列 (数値) |
[表 : 10. 返される内容]

{#ClssfnV-getTrainingStatistics__table_wph_2dw_plb}  
次の例は、アクティブなソリューションからトレーニング統計を取得する方法を示しています。

    // Get training stats
    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_incident_categorization');

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

出力：

    {
      "includedClasses": {
        "Approvals": {
          "distribution": "0.43",
          "statistics": [
            {
              "precision": "100",
              "coverage": "0",
              "recall": "0",
              "selected": "true"
            }
          ]
        }, 
        "Authentication": {
          "distribution": "4.3",
          "statistics": [
            {
              "precision": "39.33",
              "coverage": "95.31",
              "recall": "54.69",
              "selected": "false"
            },
            {
              "precision": "100",
              "coverage": "0",
              "recall": "0",
              "selected": "false"
            },
         ...
        }
        ...
      "excludedClasses": {
        "ACE": {
          "distribution": "0.11",
          "rowCount": "9"
        },
        "AHA": {
          "distribution": "0.01",
          "rowCount": "1"
        }, 
        ...
    }

## ClassificationSolutionVersion:getVersionNumber() {#ariaid-title7}

のバージョン番号を取得します ソリューションオブジェクト。
{#ClssfnV-getVersionNumber__table_jsz_sbw_plb__entry__3}

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

{#ClssfnV-getVersionNumber__table_jsz_sbw_plb} {#ClssfnV-getVersionNumber__table_ksz_sbw_plb__entry__2}

| タイプ | 説明 |
|-|-|
| 文字列 | バージョン番号。 |
[表 : 12. 返される内容]

{#ClssfnV-getVersionNumber__table_ksz_sbw_plb}  
次の例は、バージョン番号を取得する方法を示しています。

    // Get version number
    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_incident_categorization');

    gs.print("Version number: "+JSON.stringify(JSON.parse(mlSolution.getActiveVersion().getVersionNumber()), null, 2));

出力：

    Version number: 1

## ClassificationSolutionVersion - predict(オブジェクト入力、オブジェクトオプション) {#ariaid-title8}

予測の入力データを取得します。
{#ClssfnV-predict_O_O__table_wwz_pbw_plb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| input | オブジェクト | [GlideRecord](https://servicenow-prod.fluidtopics.net/k3bj5xjwIDZp86NECoEt2A#c_GlideRecordAPI "GlideRecord API はデータベース操作に使用されます。") または、フィールド名と値をキーと値のペアとして含む JSON オブジェクトのアレイ。 |
| オプション | オブジェクト | 予測結果をフィルタリングするためのオプションの値。 { "apply_threshold": Boolean, "top_n": Number } |
| options.apply_threshold | ブーリアン | ソリューションのしきい値を確認し、結果セットに適用するかどうかを示すフラグ。 有効な値： * true:信頼性がしきい値より大きい結果を返します。 * false:すべての結果を返します。 {#ClssfnV-predict_O_O__ul_f4d_xyx_slb} デフォルト：True |
| options.top_n | 数値 | 指定した場合、指定された数の予測まで、上位の結果を返します。 |
[表 : 13. パラメーター]

{#ClssfnV-predict_O_O__table_wwz_pbw_plb} {#ClssfnV-predict_O_O__table_xwz_pbw_plb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | sys_idまたはrecord_numberでソートされた予測結果を含む JSON オブジェクト。 { <identifier>: [Array] } |
| \<Object\>.\<identifier\> | 各予測結果の詳細を含むオブジェクトのリスト。 データタイプ：オブジェクトのアレイ <identifier>: [ { "confidence": Number, "predictedSysId": "String", "predictedValue": "String", "threshold": Number } ] |
| \<Object\>.\<identifier\>.\<object\>.信頼性 | 予測に関連付けられた信頼度の値。例:53.84。 データタイプ：数値 |
| \<Object\>.\<identifier\>.\<object\>.predictedSysId | 予測値のsys_id。結果は、情報が予測されている任意のテーブルから取得できます。 データタイプ：文字列 |
| \<Object\>.\<identifier\>.\<object\>.予測値 | 予測結果を表す値。 データタイプ：文字列 |
| \<Object\>.\<identifier\>.\<object\>.しきい値 | 予測に関連付けられた構成済みのしきい値の値。 データタイプ：数値 |
[表 : 14. 返される内容]

{#ClssfnV-predict_O_O__table_xwz_pbw_plb}  
次の例は、入力に GlideRecord をsys_id別に取得し、上位 3 件の結果に制限し、しきい値を除外するオプションのパラメーターを含む predict() メソッドの予測結果を表示する方法を示しています。

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

    // single GlideRecord input
    var input = new GlideRecord("incident");
    input.get("<sys_id>");

    // configure optional parameters
    var options = {};
    options.top_n = 3;
    options.apply_threshold = false;

    var results = mlSolution.getVersion(1).predict(input, options);
    // pretty print JSON results
    gs.print(JSON.stringify(JSON.parse(results), null, 2));

出力：

    {
      "<sys_id/gr>": [
        {
          "confidence": 62.10782320780268,
          "threshold": 20.36,
          "predictedValue": "Clone Issues",
          "predictedSysId": ""
        },
        {
          "confidence": 6.945237375770391,
          "threshold": 16.63,
          "predictedValue": "Instance Administration",
          "predictedSysId": ""
        },
        {
          "confidence": 5.321061076300759,
          "threshold": 23.7,
          "predictedValue": "Administration",
          "predictedSysId": ""
        }
      ]
    }

次の例は、フィールド名のアレイを入力のキーと値のペアとして受け取り、上位 3 つの結果に制限し、しきい値を除外するオプションのパラメーターを含む predict() メソッドの予測結果を表示する方法を示しています。

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

    // key-value pairs input
    var input = [{"short_description":"my email is not working"}, {short_description:"need help with password"}];

    // configure optional parameters
    var options = {};
    options.top_n = 3;
    options.apply_threshold = false;
    var results = mlSolution.predict(input, options);

    // pretty print JSON results
    gs.print(JSON.stringify(JSON.parse(results), null, 2));

出力：

    {
      "1": [
        {
          "confidence": 37.5023032262591,
          "threshold": 10.72,
          "predictedValue": "Authentication",
          "predictedSysId": ""
        },
        {
          "confidence": 24.439964862166583,
          "threshold": 23.7,
          "predictedValue": "Administration",
          "predictedSysId": ""
        },
        {
          "confidence": 11.736320486031047,
          "threshold": 100,
          "predictedValue": "Security",
          "predictedSysId": ""
        }
      ],
      "2": [
        {
          "confidence": 99,
          "threshold": 17.77,
          "predictedValue": "Email",
          "predictedSysId": ""
        },
        {
          "confidence": 3.182137005157543,
          "threshold": 10.72,
          "predictedValue": "Authentication",
          "predictedSysId": ""
        },
        {
          "confidence": 2.8773826570713514,
          "threshold": -1,
          "predictedValue": "Email (I/f)",
          "predictedSysId": ""
        }
      ]
    }

## ClassificationSolutionVersion:setPredictionSettings(オブジェクトオプション) {#ariaid-title9}

精度、範囲、または再現率の値をソリューションレベルまたはクラスレベルで設定します。
{#ClssfnV-setPredictionSettings_O__table_b45_tdw_plb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| オプション | オブジェクト | メトリクス構成値。これらの機能の詳細については、「 [ターゲット・メトリックの構成](https://www.servicenow.com/docs/access?context=configuring-target-metrics-trained-classification-solution&version=australia&pubname=australia-intelligent-experiences&ft:locale=en-US)」を参照してください。 { "metricName" : "String", "metricValue" : "String", "className" : "String" } |
| options.metricName | 文字列 | 設定するメトリクスの名前。 有効な値： * coverage{#ClssfnV-setPredictionSettings_O__classification-v-metrics-coverage} * precision{#ClssfnV-setPredictionSettings_O__classification-v-metrics-precision} * recall{#ClssfnV-setPredictionSettings_O__classification-v-metrics-recall} {#ClssfnV-setPredictionSettings_O__ul_ncd_ldx_plb} |
| options.metricValue | 文字列 | メトリクスに割り当てる数値。 |
| options.className | 文字列 | オプション。結果を制限するクラスの名前。[getTrainingStatistics()](https://servicenow-prod.fluidtopics.net/89H8JMFMF_4P1LJV6s49mA#ClssfnV-getTrainingStatistics "指定されたソリューションのすべてのトレーニング統計情報を取得します。") メソッドを使用して、ソリューションのクラスの完全なリストを取得します。 |
[表 : 15. パラメーター]

{#ClssfnV-setPredictionSettings_O__table_b45_tdw_plb} {#ClssfnV-setPredictionSettings_O__table_c45_tdw_plb__entry__2}

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

{#ClssfnV-setPredictionSettings_O__table_c45_tdw_plb}  
次の例は、「 `Clone Issues」`という名前のクラスの精度メトリクスを 89.5 に設定する方法を示しています。

    var mlSolution = sn_ml.ClassificationSolutionStore.get('ml_x_snc_global_global_classification');
    var input = {"metricName" : "precision", "metricValue" : "89.5", "className" : "Clone Issues"};

    mlSolution.getActiveVersion().setTrainingStatistics(input);


