# ローカルでのカスタムモデルのテスト

> ローカルでのカスタムモデルのテスト - DataRobot Model
> Runnerツール（DRUM）を使用して、Python、R、またはJavaカスタムモデルをDataRobotにアップロードする前にローカルでテストおよび検証します。

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-07-15T05:55:44.598237+00:00` (UTC).

## Primary page

- [ローカルでのカスタムモデルのテスト](https://docs.datarobot.com/ja/docs/api/code-first-tools/drum/custom-local-test.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [モデル要件](https://docs.datarobot.com/ja/docs/api/code-first-tools/drum/custom-local-test.html.md#model-requirements): In-page section heading.
- [DataRobot CM Runnerを使ったテストの実行](https://docs.datarobot.com/ja/docs/api/code-first-tools/drum/custom-local-test.html.md#run-tests-with-the-datarobot-cm-runner): In-page section heading.

## Documentation content

> [!NOTE] 本機能の提供について
> DataRobot Model Runnerツールにアクセスするには、DataRobotの担当者にお問い合わせください。

The DataRobot Model Runner is a tool that allows you to test Python, R, and Java custom models locally. テストでは、 [カスタムモデルをDataRobotにアップロード](https://docs.datarobot.com/ja/docs/workbench/nxt-registry/nxt-model-workshop/nxt-create-custom-model.html.md) する前に、カスタムモデルが正常に実行して予測を作成できることを確認できます。 ただし、このテストは開発のみを目的としたものです。 DataRobot recommends that you also test custom model you wish to deploy in the [Workshop](https://docs.datarobot.com/ja/docs/workbench/nxt-registry/nxt-model-workshop/nxt-test-custom-model.html.md) after uploading it.

先に進む前に、 [カスタムモデルまたは環境フォルダー設定](https://docs.datarobot.com/ja/docs/api/code-first-tools/drum/index.html.md) のガイドラインを参照します。

> [!NOTE] 備考
> DataRobot Model Runnerツールは、Python、R、Javaのカスタムモデルをサポートしています。

以下を始めとする追加機能の詳細については、 [DRUM readme](https://github.com/datarobot/datarobot-user-models?tab=readme-ov-file#datarobot-user-models) を参照してください。

- オートコンプリート
- カスタムフック
- パフォーマンス試験
- 予測サーバーでのモデルの実行
- Dockerコンテナ内でのモデルの実行

### モデル要件

フォルダーの必須の内容に加えて、DRUMでは、シリアル化されたモデルに次のものが必要です。

- 連続値モデルは、予測データの行ごとに単一の浮動小数点を返す必要があります。
- 二値分類モデルは、合計が1.0になる2つの浮動小数点値を予測データの行ごとに返す必要があります。
- 最初の値は正のクラス確率である必要があり、2番目の値は負のクラス確率である必要があります。
- 単一のpkl / pth / h5ファイルが存在する必要があります。

## DataRobot CM Runnerを使ったテストの実行

以下のコマンドを使用して、カスタムモデルのローカルテストを実行します。

```
# List all possible arguments
drum --help 
```

```
# Test a custom binary classification model
drum score -m ~/custom_model/ --input <input-dataset-filename.csv>  [--positive-class-label <labelname>] [--negative-class-label <labelname>] [--output <output-filename.csv>] [--verbose]

# Use --verbose for a more detailed output. Make batch predictions with a custom binary classification model. Optionally, specify an output file. Otherwise, predictions are returned to the command line. 
```

```
# Example: Test a custom binary classification model
drum score -m ~/custom_model/ --input 10k.csv  --positive-class-label yes --negative-class-label no --output 10k-results.csv --verbose 
```

```
# Test a custom regression model
drum score -m ~/custom_model/ --input <input-dataset-filename.csv> [--output <output-filename.csv>] [--verbose]

# Use --verbose for a more detailed output. Make batch predictions with a custom regression model. Optionally, specify an output file. Otherwise, predictions are returned to the command line. 
```

```
# Example: Test a custom regression model
drum score -m ~/custom_model/ --input fast-iron.csv --verbose

# This is an example that does not include an output command, so the prediction results return in the command line. 
```
