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


---

# ClusteringSolutionStore - グローバル

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

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

ソリューション の保存と取得を有効にします 。{#ClusteringSolutionStoreAPI__mlstore-concept-sdesc-e}

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

## ClusteringSolutionStore - add(オブジェクト mlSolution) {#ariaid-title2}

新しいソリューション オブジェクトをストアに追加し、一意の名前を返します。 {#ClusteringStore-add_O__mlstore-add-sdesc-e}
注:  
ラベル値は一意である必要はありません。たとえば、このメソッドを同じラベルで 10 回実行すると、異なる一意の名前が付けられた 10 個のオブジェクトがストアに追加されます。
{#ClusteringStore-add_O__table_vwy_1fr_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| mlSolution | [ClusteringSolution](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSolutionAPI "ClusteringSolution API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") | [ClusteringSolution()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") ストアに追加する |
[表 : 1. パラメーター]

{#ClusteringStore-add_O__table_vwy_1fr_llb} {#ClusteringStore-add_O__table_wwy_1fr_llb__entry__2}

| タイプ | 説明 |
|-|-|
| 文字列 | システムによって生成されたソリューション名。 |
[表 : 2. 返される内容]

{#ClusteringStore-add_O__table_wwy_1fr_llb}  
次の例は、ストアにソリューションを追加する方法を示しています ソリューションソリューション[ClusteringSolution - SubmitTrainingJob()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-submitTrainingJob "トレーニングジョブを送信します。") ストアに追加した後にトレーニングジョブを実行します。を使用{#ClusteringStore-add_O__mlstore-add-example-e2}

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

## ClusteringSolutionStore - deleteObject(文字列 name) {#ariaid-title3}

指定されたソリューションオブジェクトをストアから削除します。
{#ClusteringStore-deleteObject_S__table_rmj_lfr_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| name | 文字列 | [ClusteringSolution()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") 削除するオブジェクト。の名前 |
[表 : 3. パラメーター]

{#ClusteringStore-deleteObject_S__table_rmj_lfr_llb} {#ClusteringStore-deleteObject_S__table_smj_lfr_llb__entry__2}

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

{#ClusteringStore-deleteObject_S__table_smj_lfr_llb}  
次の例は、ストアからソリューションを削除する方法を示しています。

    sn_ml.ClusteringSolutionStore.deleteObject("ml_sn_global_global_solution");

## ClusteringSolutionStore - get(文字列 name) {#ariaid-title4}

ソリューションオブジェクトをストアから取得します。
{#ClusteringStore-get_S__table_zvw_v2r_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| name | 文字列 | ストア内のソリューションの名前。 |
[表 : 5. パラメーター]

{#ClusteringStore-get_S__table_zvw_v2r_llb} {#ClusteringStore-get_S__table_aww_v2r_llb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | [ClusteringSolution](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSolutionAPI "ClusteringSolution API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") 表されていますオブジェクトが存在しない場合はエラーを返します。 |
[表 : 6. 返される内容]

{#ClusteringStore-get_S__table_aww_v2r_llb}  
次の例は、get() メソッドを使用してストアからソリューションオブジェクトを取得し、 [ClusteringSolution - getActiveVersion()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-getActiveVersion "アクティブな ClusteringSolutionVersion オブジェクト。") および [ClusteringSolutionVersion - getStatus()](https://www.servicenow.com/docs/Tk82ASy627rgaFi7u_6tmQ#C-getStatus_B "トレーニング完了ステータスを取得します。") メソッドです。

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

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

出力：

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

## ClusteringSolutionStore - getAllNames(オブジェクト options) {#ariaid-title5}

ストア内のすべてのソリューション定義レコードの名前を取得します。
{#ClusteringStore-getAllNames__id_bfn_kwh_wnb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| オプション | オブジェクト | 指定されたプロパティ内の結果を制限するオプション。 { "label": "String", "domainName": "String", "scope": "String" }; |
| options.label | 文字列 | オプション。ソリューションオブジェクトのラベル。 |
| options.domainName | 文字列 | オプション。ソリューションオブジェクトのドメインの名前。参照先 [ドメインセパレーションと 予測インテリジェンス](https://www.servicenow.com/docs/access?context=domain-separation-predictive-intelligence&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US). |
| options.scope | 文字列 | オプション。ソリューションオブジェクトの [アプリケーションスコープ](https://www.servicenow.com/docs/access?context=c_ApplicationScope&version=xanadu&pubname=xanadu-application-development&ft:locale=en-US) の名前です。 |
[表 : 7. パラメーター]

{#ClusteringStore-getAllNames__id_bfn_kwh_wnb} {#ClusteringStore-getAllNames__table_aww_v2r_llb__entry__2}

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

{#ClusteringStore-getAllNames__table_aww_v2r_llb}  
次の例では、getAllNames() メソッドがストア内のすべての名前のリストを返します。

    gs.print(JSON.stringify(JSON.parse(sn_ml.ClusteringSolutionStore.getAllNames()), null, 2));

出力:

    [
      "ml_x_snc_global_global_clustering_solution_1",
      "ml_x_snc_global_global_clustering_solution"
    ]

次の例では、getAllNames() メソッドは options パラメーターに設定された値に関連付けられている名前のみを返します。

    var options = {
      'label' : 'my solution definition',
      'domainName' : 'global',
      'scope' : 'global'
    };
    var solNames = sn_ml.ClusteringSolutionStore.getAllNames(options);
    gs.print(JSON.stringify(JSON.parse(solNames), null, 2));

出力：

    [
      "ml_x_snc_global_global_my_solution_definition"
    ]

## ClusteringSolutionStore - update(文字列 name, オブジェクト mlSolution) {#ariaid-title6}

ストア内の既存のオブジェクトをパラメーターとして渡されたオブジェクトに置き換えます。指定されたオブジェクト名は空であるか、一致している必要があります。
{#ClusteringStore-update_S_O__table_v5p_wxr_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| name | 文字列 | 更新するソリューションの名前。 |
| mlSolution | [ClusteringSolution](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSolutionAPI "ClusteringSolution API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトです。") | [ClusteringSolution()](https://www.servicenow.com/docs/JNhjnRZEV1U3c4yNCXPo5A#ClusteringSol-ClusteringSolution_O "クラスターソリューションを作成します。") 更新するオブジェクトプロパティ。 |
[表 : 9. パラメーター]

{#ClusteringStore-update_S_O__table_v5p_wxr_llb} {#ClusteringStore-update_S_O__table_w5p_wxr_llb__entry__2}

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

{#ClusteringStore-update_S_O__table_w5p_wxr_llb}  
次の例は、ストア内のソリューションオブジェクトを更新する方法を示しています。

    var solutionUpdate = new sn_ml.ClusteringSolution({
      'label': 'my solution definition',
      'dataset' : myData,
      'predictedFieldName' : 'assignment_group',
      'inputFieldNames': ['short_description']
    });

    sn_ml.ClusteringSolutionStore.update('ml_sn_global_global_incident_service', solutionUpdate);


