Skip to content

アプリケーション内で をクリックすると、お使いのDataRobotバージョンに関する全プラットフォームドキュメントにアクセスできます。

予測APIスニペット

DataRobot provides sample Python code containing the commands and identifiers required to submit a CSV or JSON file for scoring. このコードは 予測APIと共に使用することができます。

追加情報については、以下の資料も参照してください。

Prediction API scripting code

予測APIスクリプティングコードを使用するには、予測を行うデプロイを開き、予測 > 予測APIをクリックします。 On the Prediction API Scripting Code page, you can choose from several scripts for Batch and Real-time predictions. 提供されたサンプルに従い、APIを介してモデルを運用アプリケーションに統合する場合は必要な変更を加えます。

To find and access the script required for your use case, configure the following settings:

Batch prediction snippet settings

コンテンツ 説明
予測タイプ 使用する予測方法を決定します。 バッチを選択します。
インターフェイス Determines the interface type of the batch prediction script you generate. Select one of the following interfaces:
  • CLI: A standalone batch prediction script using the DataRobot API Client. Before using the CLI script, if you haven't already downloaded predict.py, click download CLI tools.
  • API Client: An example batch prediction script using the DataRobot's Python package.
  • HTTP: An example batch prediction script using the raw Python-based HTTP requests.
Platform
(only for CLI)
When you select the CLI interface option, the platform setting determines the OS on which you intend to run the generated CLI prediction script. Select one of the following platform types:
  • Mac/Linux
  • Windows
スクリプトをクリップボードにコピー Copies the entire code snippet to your clipboard.
コードの概要画面 ローカルマシンにダウンロードして実行するために必要となるコードを表示します。 You should edit this code snippet to fit your needs.

Real-time prediction snippet settings

コンテンツ 説明
予測タイプ 使用する予測方法を決定します。 リアルタイムを選択します。
言語 Determines the language of the real-time prediction script generated. Select a format:
  • Python: An example real-time prediction script using the DataRobot's Python package.
  • cURL: A script using cURL, a command-line tool for transferring data using various network protocols, available by default in most Linux distributions and macOS.
スクリプトをクリップボードにコピー Copies the entire code snippet to your clipboard.
コードの概要画面 ローカルマシンにダウンロードして実行するために必要となるコードを表示します。 You should edit this code snippet to fit your needs.

コードをデプロイするには、サンプルをコピーし、次のいずれかの操作を行います。

データドリフトの無効化

個々の予測リクエストのデータドリフト追跡は、一意のヘッダーをリクエストに適用することによって無効化できます。 これは、実際の予測結果が不要な合成データを使用する場合などに便利です。

ヘッダー、X-DataRobot-Skip-Drift-Tracking=1、をリクエストデータに挿入します。 例:

    headers['X-DataRobot-Skip-Drift-Tracking'] = '1'
    requests.post(url, auth=(USERNAME, API_KEY), data=data, headers=headers) 

After you apply this header, drift tracking is not calculated for the request. しかし、サービス統計は引き続き提供されます(データエラー、システムエラー、実行時間など)。

モニタリングスニペット

外部モデルデプロイを作成すると、監視エージェントでデプロイ統計をレポートするにはモニタリングスニペットを使用する必要があることが通知されます。

デプロイでスニペットを表示するには、ページの下部にあるリンクを使用するか、予測 > モニタリングにナビゲートします。

モニタリングスニペットは、モデルの統計をDataRobot MLOpsに送信し、その統計をデプロイで表すように設計されています。 この機能を使用して、スコアリングコード指標をデプロイにレポートします。

デプロイでスコアリングコードを実装するには、Java言語を選択し、スニペットを使用する準備ができたらスニペットをクリップボードにコピーします。 詳細な手順については、監視エージェントの内部ドキュメントに含まれているクイックスタートガイドを参照してください。

デプロイを監視するように監視エージェントをまだ設定していない場合、MLOPsエージェントのtarballのダウンロードは、モニタリングタブから行うことができます。 エージェントをセットアップするための追加ドキュメントは、tarballに含まれています。


更新しました December 21, 2022
Back to top