---
sourceDocument: Xanadu API リファレンス
sourceDocumentLink: https://www.servicenow.com/docs/r/ja-JP/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ClusteringSolution - グローバル

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

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

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

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

1. [DatasetDefinition](https://www.servicenow.com/docs/kERREiAlGZUL679rFNdNtw#DatasetDefinitionAPI "DatasetDefinition API は、ML トレーニングアルゴリズムの入力として使用する、テーブル名、列、および行の選択基準を含むレコードのセット。データセットには実際のデータは含まれていません。") API を使用してデータセットを作成します。
2. K 平均法クラスタリングアルゴリズムを使用する場合は必須です。[Encoder](https://www.servicenow.com/docs/vZtCHwQ5a_NlIiS99H8RMA#EncoderAPI "Encoder API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトを提供します。このオブジェクトは、Encoder 固有の目標と構成に基づいて、入力データを数値のベクトルに変換します。エンコーダーは、エンコーディングを実行するために個別に使用することも、テキスト列をエンコードするソリューションの一部として構成することもできます。") API を使用してエンコーダーを構築します。
3. [コンストラクタ―](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。")を使用して、クラスタリングソリューションオブジェクトを作成します。
4. [ClusteringSolutionStore - add()](https://www.servicenow.com/docs/DzNjNUD44HbHWLENi4N96Q#ClusteringStore-add_O "新しいソリューション オブジェクトをストアに追加し、一意の名前を返します。") メソッドを使用して、ソリューションオブジェクトをクラスタリングソリューションストアに追加します。
5. [submitTrainingJob()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-submitTrainingJob "トレーニングジョブを送信します。") メソッドを使用してソリューションをトレーニングします。これにより、[ClusteringSolutionVersion](https://www.servicenow.com/docs/Tk82ASy627rgaFi7u_6tmQ#ClusteringSolutionVersionAPI "ClusteringSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") API を使用して管理できるオブジェクトのバージョンが作成されます。
6. [ClusteringSolutionVersion -- predict()](https://www.servicenow.com/docs/Tk82ASy627rgaFi7u_6tmQ#C-predict_O_O "予測の入力データを取得します。") メソッドを使用して予測を取得します。

{#ClusteringSolutionAPI__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)」を参照してください。

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

クラスターソリューションを作成します。
{#ClusteringSol-ClusteringSolution_O__table_gm2_yt5_flb__entry__3}{#ClusteringSol-ClusteringSolution_O__cluster-dbscan-distanceM-vals}{#ClusteringSol-ClusteringSolution_O__cluster-dbscan-epsilon-desc}{#ClusteringSol-ClusteringSolution_O__cluster-dbscan-minNeighbs-desc}{#ClusteringSol-ClusteringSolution_O__cluster-kmeans-targetC-desc}{#ClusteringSol-ClusteringSolution_O__solution-obj-domainN-default}{#ClusteringSol-ClusteringSolution_O__solution-cluster-minrec-desc}{#ClusteringSol-ClusteringSolution_O__solution-obj-stop-desc}

| 名前 | タイプ | 説明 |
|-|-|-|
| config | オブジェクト | の構成プロパティを含む JavaScript オブジェクト ソリューション。 { "algorithmConfig": {Object}, "clusterConcept": "String", "clusterConceptFieldNames": [Array], "dataset": {Object}, "domainName": "String", "encoder": {Object}, "groupByFieldName": "String", "groupUnclusteredRecords": Boolean, "inputFieldNames": [Array], "label": "String", "maxTimeWindowForUpdate" : Number, "minRecordsPerCluster" : Number, "minRowCount": "String", "processingLanguage": "String", "stopwords": [Array], "trainingFrequency": "String", "updateFrequency": "String" } |
| config.algorithmConfig | オブジェクト | encoder プロパティを設定する場合を除き、必須です。アルゴリズム設定プロパティを含む JavaScript オブジェクト。 プロパティの設定は、algorithm プロパティに設定された値によって異なります。 'algorithmConfig': { "algorithm": "String", // See algorithmConfig.algorithm setting description for property settings based on algorithm } |
| config.algorithmConfig.algorithm | 文字列 | ソリューションをエンコードする方法。 有効な値： * dbscan：Density-Based Spatial Clustering of Applications with Noise (DBSCAN、ノイズのあるアプリケーションの密度ベース空間クラスタリング) クラスタリングアルゴリズム。このアルゴリズムで使用されるプロパティ： * distanceMetric * epsilon * minimumNeighbours {#ClusteringSol-ClusteringSolution_O__ul_cfy_mkk_xlb} * hdbscan：Hierarchical Density Based Spatial Clustering of Applications with Noise (HDBSCAN、ノイズのあるアプリケーションの階層密度ベース空間クラスタリング) クラスタリングアルゴリズム。このアルゴリズムで使用されるプロパティ： * minimumSamples {#ClusteringSol-ClusteringSolution_O__ul_o3n_zcw_wnb} * kmeans：K 平均法クラスタリングアルゴリズム。デフォルトです。このアルゴリズムでは targetCoverage プロパティが使用されます。 {#ClusteringSol-ClusteringSolution_O__ul_wtd_l2k_xlb} DBSCAN の使用を好むユーザーもいます。クラスタリングの前にデータ内のクラスター数を指定する必要がないためです。 dbscan のプロパティ： 'algorithmConfig': { "algorithm": "dbscan", "distanceMetric": "String", "epsilon": Number, "minimumNeighbours": Number } hdbscan のプロパティ： 'algorithmConfig': { "algorithm": "hdbscan", "minimumSamples": Number } kmeans のプロパティ： 'algorithmConfig': { "algorithm": "kmeans", "targetCoverage": Number } |
| config.algorithmConfig.distanceMetric | 文字列 | DBSCAN アルゴリズムのみ。類似のデータオブジェクトをスキャンする距離測定基準。 有効な値：levenshteinDistance |
| config.algorithmConfig.epsilon | 番号 | DBSCAN アルゴリズムのみ。近接検索半径のサイズを表す 0 と 1 の間の小数値。 |
| config.algorithmConfig.minimumNeighbours | 番号 | DBSCAN アルゴリズムのみ。ポイントがクラスターの一部となるために必要な近接の最小数。levenshteinDistance の場合、データセットから除外されるポイントがないように、値を 1 にする必要があります。 |
| config.algorithmConfig.minimumSamples | 番号 | ポイントがコアポイントであるかどうかを判断するために必要な、近隣のデータサンプルの最小数。 デフォルト：なし |
| config.algorithmConfig.targetCoverage | 番号 | K 平均法アルゴリズムのみ。互いにあまり類似していないレコードを除外するためのパーセンタイルフィールド。 |
| config.clusterConcept | 文字列 | オプション。概念タイプ。概念は、頻度の高い順にリストされた一連の単語です。TFIDF ベースのクラスターの概念を生成するには、値を `tfidf`に設定します。概念タイプは、クラスタリング定義 \[ml_capability_definition_clustering\] テーブルに一覧表示されます。 デフォルト：頻度ベースのクラスターの概念 |
| config.clusterConceptFieldNames | アレイ | オプション。クラスターの概念フィールド名のリスト。これらの値は、クラスターの概念を作成するための外部列であり、クラスターソリューションのトレーニングには使用されません。外部列が指定されている場合、それらの列はクラスターの概念にのみ使用され、クラスタリングソリューションのトレーニングには使用されません。クラスターの概念フィールドはクラスタリング定義 \[ml_capability_definition_clustering\] テーブルにリストされます。 デフォルト：入力テキスト列でクラスターの概念を生成 |
| config.dataset | オブジェクト | [DatasetDefinition](https://www.servicenow.com/docs/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 | オブジェクト | algorithmConfig プロパティを `"levenshteinDistance"` に設定する場合を除き、必須です。このソリューションに割り当てるトレーニング済みのエンコーダーオブジェクト。「[Encoder - Encoder(オブジェクト config)](https://www.servicenow.com/docs/vZtCHwQ5a_NlIiS99H8RMA#Encoder-Encoder_O "Encoder を作成します。")」を参照してください。 |
| config.groupByFieldName | 文字列 | オプション。 レコードを 1 つ以上のクラスターにグループ化するためのフィールド名。 次のセットアップ例では、各タイプが個別のクラスターにグループ化され、10 個のクラスターがレンダリングされます。 * groupByFieldName の値は `'category'` です * [DatasetDefinition](https://www.servicenow.com/docs/kERREiAlGZUL679rFNdNtw#DatasetDefinitionAPI "DatasetDefinition API は、ML トレーニングアルゴリズムの入力として使用する、テーブル名、列、および行の選択基準を含むレコードのセット。データセットには実際のデータは含まれていません。") tableName 値は`「incident」`です * インシデント \[incident\] テーブルには 10 個のカテゴリタイプがあります {#ClusteringSol-ClusteringSolution_O__ul_bt4_y3h_dmb} |
| config.groupUnclusteredRecords | ブーリアン | 結果内でクラスター化されていないレコードをグループ化するかどうかを示すフラグ。 有効な値： * true：結果内でクラスター化されていないレコードを個別にグループ化します。 * false：結果内でクラスター化されていないレコードをグループ化しません。クラスター化されていない値 (-1) は残りの結果とともに表示されます。 {#ClusteringSol-ClusteringSolution_O__ul_ar4_blq_wnb} デフォルト値：false |
| config.inputFieldNames | アレイ | 文字列としての入力フィールド名のリスト。モデルは、次のフィールドを使用して予測を行います。 |
| config.label | 文字列 | 予測タスクを識別します。 |
| config.maxTimeWindowForUpdate | 番号 | オプション。モデル更新ポイントから遡ってレコードを検索する時間 (分)。例えば、値が 15 の場合、システムは過去 15 分間に作成されたレコードのみを検索します。デフォルトでは、すべてのレコードがスキャンされます。 |
| config.minRecordsPerCluster | 番号 | オプション。クラスター内で使用可能なレコードの最小数。値は 2 以上でなければなりません。 デフォルト値：2 |
| config.minRowCount | 文字列 | オプション。トレーニング用のデータセットに必要なレコードの最小数。 デフォルト：10000 |
| config.processingLanguage | 文字列 | 2 文字の ISO 639-1 言語コード形式の処理言語。 |
| 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 {#ClusteringSol-ClusteringSolution_O__ul_pmw_523_plb}デフォルト：run_once |
| config.updateFrequency |   | ソリューション定義のモデルを再構築する必要がある頻度。 可能な値： * do_not_update * every_1_day * every_1_hour * every_6_hours * every_12_hours * every_1_minute * every_15_minutes * every_30_minutes {#ClusteringSol-ClusteringSolution_O__ul_kjm_2jh_3mb}デフォルト：do_not_update |
[表 : 1. パラメーター]

{#ClusteringSol-ClusteringSolution_O__table_gm2_yt5_flb}  
次の例は、オブジェクトを作成して ClusteringSolution ストア。この例は、トレーニングのためにオブジェクトを送信する方法も示しています。

    try{
        var myData = new sn_ml.DatasetDefinition({
            'tableName' : 'incident',
            'fieldNames' : ['category', 'short_description', 'state', 'description'],
            'encodedQuery' : 'activeANYTHING'
        });

        // get a trained encoder from the store
        var myEncoder = sn_ml.EncoderStore.get('<encoder_name >');
            
        var mySolution = new sn_ml.ClusteringSolution({
            'label': "clustering solution",
            'dataset' : myData,
            'encoder' : myEncoder,
            'inputFieldNames':['short_description'],                
            'groupByFieldName' : 'category',        
            'algorithmConfig' : {
                'algorithm' : 'kmeans',
                'targetCoverage' : '90'
            }
        });
        
        // add solution
        var solutionName = sn_ml.ClusteringSolutionStore.add(mySolution);
        var solutionVersion = mySolution.submitTrainingJob();    
        var trainingStatus = solutionVersion.getStatus();
        gs.print(JSON.stringify(JSON.parse(trainingStatus), null, 2));
    ​
    } catch(ex){
        gs.print('Exception caught: '+ ex.getMessage());
    }

出力:

    {
      "state": "waiting_for_training",
      "percentComplete": "0",
      "hasJobEnded": "false"
    }

次の例は、'description' フィールドをクラスターの概念フィールドとして含める方法を示しています。

    var myIncidentData = new sn_ml.DatasetDefinition({
        'tableName' : 'incident',
        'fieldNames' : ['category', 'short_description', 'description'],
    });

    var encodersolutionName = sn_ml.EncoderStore.get('<encoder_name >');

    var mySolution = new sn_ml.ClusteringSolution({
    	'label': 'clustering_test',
    	'dataset': myIncidentData,
    	'inputFieldNames': ['short_description'],
    	'encoder': encodersolutionName,
    	'clusterConceptFieldNames': ['description']
    });

    var solutionNameFromStore = sn_ml.ClusteringSolutionStore.add(mySolution);
    var myClassifier = mySolution.submitTrainingJob(); 

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

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

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

{#ClusteringSol-cancelTrainingJob__table_bpb_k3z_llb} {#ClusteringSol-cancelTrainingJob__table_cpb_k3z_llb__entry__2}

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

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

    var mySolution = sn_ml.ClusteringSolutionStore.get('ml_sn_global_global_clustering');

    mySolution.cancelTrainingJob();

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

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

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

{#ClusteringSol-getActiveVersion__table_tvl_m3z_llb} {#ClusteringSol-getActiveVersion__table_uvl_m3z_llb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | アクティブな [ClusteringSolutionVersion](https://www.servicenow.com/docs/Tk82ASy627rgaFi7u_6tmQ#ClusteringSolutionVersionAPI "ClusteringSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") オブジェクト。 |
[表 : 5. 返される内容]

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

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

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

出力：

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

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

クラスタリングソリューション のすべてのバージョンを取得します
{#ClusteringSol-getAllVersions__table_tvl_m3z_llb__entry__3}

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

{#ClusteringSol-getAllVersions__table_tvl_m3z_llb} {#ClusteringSol-getAllVersions__table_uvl_m3z_llb__entry__2}

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

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

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

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

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

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

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

{#ClusteringSol-getLatestVersion__table_tvl_m3z_llb} {#ClusteringSol-getLatestVersion__table_uvl_m3z_llb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClusteringSolutionVersion](https://www.servicenow.com/docs/Tk82ASy627rgaFi7u_6tmQ#ClusteringSolutionVersionAPI "ClusteringSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") の最新バージョンに対応するオブジェクト[ClusteringSolution()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") です。 |
[表 : 9. 返される内容]

{#ClusteringSol-getLatestVersion__table_uvl_m3z_llb}  
次の例は、ソリューションの最新バージョンを取得して、トレーニングのステータスを返す方法を示しています。{#ClusteringSol-getLatestVersion__mlsol-getLatestVersion-example}

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

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

出力：

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

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

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

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

{#ClusteringSol-getName__table_pps_43z_llb} {#ClusteringSol-getName__table_qps_43z_llb__entry__2}

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

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

    // Update solution
    var myIncidentData = new sn_ml.DatasetDefinition({
       'tableName' : 'incident',
       'fieldNames' : ['category', 'short_description', 'priority'],
       'encodedQuery' : 'activeANYTHING'
    });

    var eligibleFields = JSON.parse(myIncidentData.getEligibleFields('clustering'));

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

    // update solution
    sn_ml.ClusteringSolutionStore.update('ml_x_snc_global_global_clustering_solution', myCluster);

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

出力：

    Solution Name: ml_x_snc_global_global_clustering_solution

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

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

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

{#ClusteringSol-getProperties__table_pps_43z_llb} {#ClusteringSol-getProperties__table_qps_43z_llb__entry__2}{#ClusteringSol-getProperties__solution-obj-group-desc}

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClusteringSolutionStore](https://www.servicenow.com/docs/DzNjNUD44HbHWLENi4N96Q#ClusteringSolutionStoreAPI "ソリューション の保存と取得を有効にします 。") のデータセットのコンテンツと [ClusteringSolution()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") オブジェクトの詳細。 { "algorithmConfig": {Object}, "datasetProperties": {Object}, "domainName": "String", "encoder": {Object}, "groupByFieldName": "String", "inputFieldNames": [Array], "label": "String", "minRecordsPerCluster" : Number, "name": "String", "processingLanguage": "String", "scope": "String", "stopwords": [Array], "trainingFrequency": "String", "updateFrequency": "String" } |
| \<Object\>.algorithmConfig | アルゴリズム設定プロパティを含む JavaScript オブジェクト。 プロパティの結果は、algorithm プロパティに設定された値によって異なります。 'algorithmConfig' : { "algorithm": "String", // See algorithmConfig.algorithm setting description for property settings based on algorithm } データタイプ：オブジェクト。 |
| \<Object\>.algorithmConfig.algorithm | ソリューションをエンコードする方法。 dbscan のプロパティ： 'algorithmConfig': { "algorithm": "dbscan", "distanceMetric": "String", "epsilon": Number, "minimumNeighbours": Number } kmeans のプロパティ： 'algorithmConfig': { "algorithm": "kmeans", "targetCoverage": Number } データタイプ：文字列。 |
| \<Object\>.algorithmConfig.distanceMetric | DBSCAN アルゴリズムのみ。類似のデータオブジェクトをスキャンする距離測定基準。 データタイプ：文字列。 |
| \<Object\>.algorithmConfig.epsilon | DBSCAN アルゴリズムのみ。近接検索半径のサイズを表す 0 と 1 の間の小数値。 データタイプ：数値。 |
| \<Object\>.algorithmConfig.minimumNeighbours | DBSCAN アルゴリズムのみ。ポイントがクラスターの一部となるために必要な近接の最小数。levenshteinDistance の場合、データセットから除外されるポイントがないように、値を 1 にする必要があります。 データタイプ：数値。 |
| \<Object\>.algorithmConfig.targetCoverage | K 平均法アルゴリズムのみ。互いにあまり類似していないレコードを除外するためのパーセンタイルフィールド。 データタイプ：数値。 |
| \<Object\>.datasetProperties | ソリューションに関連付けられた [DatasetDefinition()](https://www.servicenow.com/docs/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\>.encoderProperties | このソリューションに割り当てられるエンコーダーオブジェクト。「[Encoder - Encoder(オブジェクト config)](https://www.servicenow.com/docs/vZtCHwQ5a_NlIiS99H8RMA#Encoder-Encoder_O "Encoder を作成します。")」を参照してください。 データタイプ：オブジェクト |
| \<Object\>.groupByFieldName | レコードを 1 つ以上のクラスターにグループ化するためのフィールド名。 データタイプ：文字列 |
| \<Object\>.inputFieldNames | 文字列としての入力フィールド名のリスト。モデルは、次のフィールドを使用して予測を行います。 データタイプ：文字列。 |
| \<Object\>.label | 予測タスクを識別します。 { "label": "my first prediction" } データタイプ：文字列。 |
| \<Object\>.minRecordsPerCluster | クラスター内で使用可能なレコードの最小数。 データタイプ：数値。 |
| \<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 {#ClusteringSol-getProperties__ul_pmw_523_plb}デフォルト：run_once データタイプ：文字列。 |
| \<Object\>.updateFrequency | ソリューション定義のモデルを再構築する必要がある頻度。 可能な値： * do_not_update * every_1_day * every_1_hour * every_6_hours * every_12_hours * every_1_minute * every_15_minutes * every_30_minutes {#ClusteringSol-getProperties__ul_kjm_2jh_3mb}デフォルト：do_not_update データタイプ：文字列 |
[表 : 13. 返される内容]

{#ClusteringSol-getProperties__table_qps_43z_llb}  
次の例では、ストア内のソリューションオブジェクトのプロパティを取得します。{#ClusteringSol-getProperties__mlsol-getProps-example-other2}

    var myCluster = new sn_ml.ClusteringSolutionStore.get("ml_x_snc_global_global_clustering_solution");

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

データタイプ：数値。

    *** Script: {
      "algorithmConfig": {
        "algorithm": "kmeans",
        "targetCoverage": "90"
      },
      "datasetProperties": {
        "tableName": "incident",
        "fieldNames": [
          "category",
          "short_description",
          "state",
          "description"
        ],
        "encodedQuery": "activeANYTHING"
      },
      "domainName": "global",
      "encoderProperties": {
        "datasetsProperties": [
          {
            "tableName": "incident",
            "fieldNames": [
              "assignment_group",
              "short_description",
              "description"
            ],
            "encodedQuery": "activeANYTHING"
          }
        ],
        "domainName": "global",
        "label": "my encoder definition",
        "name": "ml_x_snc_global_global_my_encoder_definition",
        "processingLanguage": "en",
        "scope": "global",
        "stopwords": [
          "Default English Stopwords"
        ],
        "trainingFrequency": "run_once"
      },
      "groupByFieldName": "category",
      "inputFieldNames": [
        "short_description"
      ],
      "label": "clustering solution",
      "minRecordsPerCluster": 2,
      "name": "ml_x_snc_global_global_clustering_solution",
      "processingLanguage": "en",
      "scope": "global",
      "stopwords": [
        "Default English Stopwords"
      ],
      "trainingFrequency": "run_once",
      "updateFrequency": "do_not_update"
    }}

## ClusteringSolution - getVersion(文字列 version) {#ariaid-title9}

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

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

{#ClusteringSol-getVersion_S__table_pps_43z_llb} {#ClusteringSol-getVersion_S__table_qps_43z_llb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClusteringSolutionVersion](https://www.servicenow.com/docs/Tk82ASy627rgaFi7u_6tmQ#ClusteringSolutionVersionAPI "ClusteringSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") API メソッドを呼び出すことができる [ClusteringSolution()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") オブジェクトの指定されたバージョン。 |
[表 : 15. 返される内容]

{#ClusteringSol-getVersion_S__table_qps_43z_llb}  
次の例は、バージョン番号別にソリューションのトレーニングステータスを取得する方法を示しています。{#ClusteringSol-getVersion_S__mlsol-gerversion-example-other}

    var mlSolution = sn_ml.ClusteringSolutionStore.get('ml_x_snc_global_global_clustering');

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

データタイプ：数値。

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

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

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

| 名前 | タイプ | 説明 |
|-|-|-|
| version | 文字列 | アクティブ化する [ClusteringSolution()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") オブジェクトバージョンの名前。 このバージョンをアクティブ化すると、他のバージョンが非アクティブになります。 |
[表 : 16. パラメーター]

{#ClusteringSol-setActiveVersion_S__table_pps_43z_llb} {#ClusteringSol-setActiveVersion_S__table_qps_43z_llb__entry__2}

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

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

    sn_ml.ClusteringSolution.setActiveVersion("ml_incident_categorization");

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

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

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

{#ClusteringSol-submitTrainingJob__table_xmd_33z_llb} {#ClusteringSol-submitTrainingJob__table_ymd_33z_llb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClusteringSolutionVersion](https://www.servicenow.com/docs/Tk82ASy627rgaFi7u_6tmQ#ClusteringSolutionVersionAPI "ClusteringSolutionVersion API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") に対応するオブジェクト [ClusteringSolution](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") トレーニング対象 |
[表 : 19. 返される内容]

{#ClusteringSol-submitTrainingJob__table_ymd_33z_llb}  
次の例は、データセットを作成してソリューションに適用し、ソリューション をストアに追加して、トレーニングジョブを送信する方法を示しています。{#ClusteringSol-submitTrainingJob__mlsol-submit-example-nonSol2}

    // Create a dataset 
    var myData = new sn_ml.DatasetDefinition({

      'tableName' : 'incident',
      'fieldNames' : ['assignment_group', 'short_description', 'description'],
      'encodedQuery' : 'activeANYTHING'

    });

    // get a trained encoder from the store
    var myEncoder = sn_ml.EncoderStore.get('ml_x_snc_global_global_encoder');

    // Create a solution 
    var mySolution = new sn_ml.ClusteringSolution({

      'label': "my solution definition",
      'dataset' : myData,
      'encoder' : myEncoder,
      '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.ClusteringSolutionStore.add(mySolution);

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


