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


---

# EncoderStore - グローバル

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

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

EncoderStore API には、エンコーダーを格納および取得するためのメソッドが用意されています。

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

## EncoderStore - add(オブジェクト mlEncoder) {#ariaid-title2}

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

| 名前 | タイプ | 説明 |
|-|-|-|
| mlEncoder | [Encoder](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#EncoderAPI "Encoder API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトを提供します。このオブジェクトは、Encoder 固有の目標と構成に基づいて、入力データを数値のベクトルに変換します。エンコーダーは、エンコーディングを実行するために個別に使用することも、テキスト列をエンコードするソリューションの一部として構成することもできます。") | [Encoder()](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#Encoder-Encoder_O "Encoder を作成します。") ストアに追加する |
[表 : 1. パラメーター]

{#EncoderStore-add_O__table_vwy_1fr_llb} {#EncoderStore-add_O__table_wwy_1fr_llb__entry__2}

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

{#EncoderStore-add_O__table_wwy_1fr_llb}  
次の例は、ストアにソリューションを追加する方法を示しています エンコーダー ソリューション 次を使用 [Encoder - submitTrainingJob()](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#Encoder-submitTrainingJob "トレーニングジョブを送信します。") ストアに追加した後にトレーニングジョブを実行します。{#EncoderStore-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'

    });

    // Create a solution 
    var myEncoder = new sn_ml.Encoder({

      'label': "my encoder definition",
      'datasets' : [myData],
      'predictedFieldName' : 'assignment_group',
      'inputFieldNames':['short_description']

    });

    // Add the encoder to the store to later be able to retrieve it.
    var my_unique_name = sn_ml.EncoderStore.add(myEncoder);

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

指定された Encoder オブジェクトをストアから削除します。
{#EncoderStore-deleteObject_S__table_rmj_lfr_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| name | 文字列 | [Encoder()](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#Encoder-Encoder_O "Encoder を作成します。") 削除するオブジェクト。 の名前 |
[表 : 3. パラメーター]

{#EncoderStore-deleteObject_S__table_rmj_lfr_llb} {#EncoderStore-deleteObject_S__table_smj_lfr_llb__entry__2}

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

{#EncoderStore-deleteObject_S__table_smj_lfr_llb}  
次の例は、ストアから Encoder を削除する方法を示しています。

    sn_ml.EncoderStore.deleteObject("ml_sn_global_global_encoder");

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

ストアから Encoder オブジェクトを取得します。
{#EncoderStore-get_S__table_zvw_v2r_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| name | 文字列 | ストア内の Encoder の名前です。 |
[表 : 5. パラメーター]

{#EncoderStore-get_S__table_zvw_v2r_llb} {#EncoderStore-get_S__table_aww_v2r_llb__entry__2}

| タイプ | 説明 |
|-|-|
| オブジェクト | [Encoder](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#EncoderAPI "Encoder API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトを提供します。このオブジェクトは、Encoder 固有の目標と構成に基づいて、入力データを数値のベクトルに変換します。エンコーダーは、エンコーディングを実行するために個別に使用することも、テキスト列をエンコードするソリューションの一部として構成することもできます。") 表されていますオブジェクトが存在しない場合はエラーを返します。 |
[表 : 6. 返される内容]

{#EncoderStore-get_S__table_aww_v2r_llb}  
次の例は、get() メソッドを使用してストアから Encoder オブジェクトを取得し、[Encoder - getActiveVersion()](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#Encoder-getActiveVersion "アクティブな EncoderVersion オブジェクト。") および [EncoderVersion - getStatus()](https://servicenow-prod.fluidtopics.net/v9I7ZQ6xC0UGYNi2LNpDGg#EncoderV-getStatus_B "トレーニング完了ステータスを取得します。") メソッドを使用してそのトレーニングステータスを表示する方法を示しています。

    // Get status
    var myEncoder = sn_ml.EncoderStore.get('ml_incident_categorization');

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

出力:

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

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

ストア内のすべての Encoder 定義レコードの名前を取得します。
{#EncoderStore-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. パラメーター]

{#EncoderStore-getAllNames__id_bfn_kwh_wnb} {#EncoderStore-getAllNames__table_aww_v2r_llb__entry__2}

| タイプ | 説明 |
|-|-|
| アレイ | ストア内の Encoder オブジェクトの名前を表す文字列のリストです。 |
[表 : 8. 返される内容]

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

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

出力:

    [
      "ml_x_snc_global_global_classification_word_corpus",
      "ml_x_snc_global_global_predictability_estimate",
      "GloVe",
      "ml_x_snc_global_global_encoder",
      "ml_x_snc_global_global_predictability_estimate_1"
    ]

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

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

出力：

    [
      "ml_x_snc_global_global_my_encoder_definition"
    ]

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

ストア内の Encoder オブジェクトを更新します。
{#EncoderStore-update_S_O__table_v5p_wxr_llb__entry__3}

| 名前 | タイプ | 説明 |
|-|-|-|
| name | 文字列 | 更新する Encoder の名前です。 |
| mlEncoder | [Encoder](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#EncoderAPI "Encoder API は、予測インテリジェンス ストアで使用されるスクリプト可能なオブジェクトを提供します。このオブジェクトは、Encoder 固有の目標と構成に基づいて、入力データを数値のベクトルに変換します。エンコーダーは、エンコーディングを実行するために個別に使用することも、テキスト列をエンコードするソリューションの一部として構成することもできます。") | [Encoder()](https://servicenow-prod.fluidtopics.net/vZtCHwQ5a_NlIiS99H8RMA#Encoder-Encoder_O "Encoder を作成します。") 更新するオブジェクトプロパティ。 |
[表 : 9. パラメーター]

{#EncoderStore-update_S_O__table_v5p_wxr_llb} {#EncoderStore-update_S_O__table_w5p_wxr_llb__entry__2}

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

{#EncoderStore-update_S_O__table_w5p_wxr_llb}  
次の例は、ストア内の Encoder オブジェクトを更新する方法を示しています。

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

    sn_ml.EncoderStore.update('ml_sn_global_global_incident_service', encoderUpdate);


