# 大規模なデータセットの予測

> 大規模なデータセットの予測 - バッチ予測APIを使用して、大規模なデータセットの予測を作成する例を説明します。

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-27T18:44:30.262467+00:00` (UTC).

## Primary page

- [大規模なデータセットの予測](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/large-preds-api.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [1. バッチ予測ジョブを作成する](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/large-preds-api.html.md#1-create-a-batch-prediction-job): In-page section heading.
- [2. バッチ予測ジョブのステータスを確認します。](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/large-preds-api.html.md#2-check-the-status-of-the-batch-prediction-job): In-page section heading.
- [3. バッチ予測ジョブの結果をダウンロードします。](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/large-preds-api.html.md#3-download-the-results-of-the-batch-prediction-job): In-page section heading.

## Documentation content

[ファイルサイズ制限](https://docs.datarobot.com/ja/docs/classic-ui/predictions/pred-file-limits.html.md) は予測方法によって異なります。大規模なデータセットの予測には、バッチ予測APIまたはリアルタイム予測APIを使用します。

次の例に、バッチ予測APIを使用して大規模データセットの予測を作成する方法を示します。 リアルタイム予測に関する [予測API](https://docs.datarobot.com/ja/docs/api/reference/predapi/legacy-predapi/dr-predapi.html.md) を参照してください。

この例では、予測データセットはAIカタログに保存されます。 バッチ予測APIは、 [他の場所](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/intake-options.html.md) からのデータでの予測もサポートします。 AIカタログからのデータセットでの予測では、データセットのスナップショットを取得する必要がある点に注意してください。

バッチ予測APIを使用するには、すべてのAPIリクエストのヘッダーで送信されるAPIキーに加えて以下の項目が必要です。

1. <deployment_id> : 予測を作成するために使用するモデルのデプロイID。
2. <dataset_id> : モデル <deployment_id> で使用されるスナップショット取得済みAIカタログのデータセットID。

以下の手順は、 `batchPredictions` APIエンドポイントを使用して100MB以上のファイルで作業する方法を示します。 以下は手順のサマリーです。

1. デプロイ済みモデルおよび使用するデータセットを示すBatchPredictionジョブを作成します。
2. BatchPredictionジョブのステータスで完了するのを確認します。
3. 結果をダウンロードします。

### 1. バッチ予測ジョブを作成する

`POST https://app.datarobot.com/api/v2/batchPredictions`

サンプルリクエスト：

```
{
    "deploymentId": "<deployment_id>",
    "intakeSettings": {
        "type": "dataset",
        "datasetId": "<dataset_id>"
    }
} 
```

サンプルの時系列リクエスト（時系列プロダクトおよび 時系列のバッチ予測 プレビューフラグが必要です）：

```
{
    "deploymentId": "<deployment_id>",
    "intakeSettings": {
        "type": "dataset",
        "datasetId": "<dataset_id>"
    },
    "timeseriesSettings": {
        "type": "forecast"
    }
} 
```

応答の例：

応答の `links.self` プロパティには、次の2つの手順で使用するURLが含まれています。

```
{
 "status": "INITIALIZING",
    "skippedRows": 0,
    "failedRows": 0,
    "elapsedTimeSec": 0,
    "logs": [
        "Job created by user@example.com from 10.1.2.1 at 2020-02-19 22:41:00.865000"
    ],
    "links": {
        "download": null,
        "self": "https://app.datarobot.com/api/v2/batchPredictions/a1b2c3d4x5y6z7/"
    },
    "jobIntakeSize": null,
    "scoredRows": 0,
    "jobOutputSize": null,
    "jobSpec": {
        "includeProbabilitiesClasses": [],
        "maxExplanations": 0,
        "predictionWarningEnabled": null,
        "numConcurrent": 4,
        "thresholdHigh": null,
        "passthroughColumnsSet": null,
        "csvSettings": {
            "quotechar": "\"",
            "delimiter": ",",
            "encoding": "utf-8"
        },
        "thresholdLow": null,
        "outputSettings": {
            "type": "localFile"
        },
        "includeProbabilities": true,
        "columnNamesRemapping": {},
        "deploymentId": "<deployment_id>",
        "abortOnError": true,
        "intakeSettings": {
            "type": "dataset",
            "datasetId": "<dataset_id>"
        },
        "includePredictionStatus": false,
        "skipDriftTracking": false,
        "passthroughColumns": null
    },
    "statusDetails": "Job created by user@example.com from 10.1.2.1 at 2020-02-19   22:41:00.865000",
    "percentageCompleted": 0.0
} 
```

`links.self` プロパティ `https://app.datarobot.com/api/v2/batchPredictions/a1b2c3d4x5y6z7/` は、次の手順2のGET呼び出しの特徴量 `<batch_prediction_job_status_url>` です。

### 2. バッチ予測ジョブのステータスを確認します。

`GET <batch_prediction_job_status_url>`

応答の例：

```
{
    "status": "INITIALIZING",
    "skippedRows": 0,
    "failedRows": 0,
    "elapsedTimeSec": 352,
    "logs": [
        "Job created by user@example.com from 10.1.2.1 at 2020-02-19 22:41:00.865000",
        "Job started processing at 2020-02-19 22:41:16.192000"
    ],
    "links": {
        "download": "https://app.datarobot.com/api/v2/batchPredictions/a1b2c3d4x5y6z7/download/",
        "self": "https://app.datarobot.com/api/v2/batchPredictions/a1b2c3d4x5y6z7/"
    },
    "jobIntakeSize": null,
    "scoredRows": 1982300,
    "jobOutputSize": null,
    "jobSpec": {
        "includeProbabilitiesClasses": [],
        "maxExplanations": 0,
        "predictionWarningEnabled": null,
        "numConcurrent": 4,
        "thresholdHigh": null,
        "passthroughColumnsSet": null,
        "csvSettings": {
            "quotechar": "\"",
            "delimiter": ",",
            "encoding": "utf-8"
        },
        "thresholdLow": null,
        "outputSettings": {
            "type": "localFile"
        },
        "includeProbabilities": true,
        "columnNamesRemapping": {},
        "deploymentId": "<deployment_id>",
        "abortOnError": true,
        "intakeSettings": {
            "type": "dataset",
            "datasetId": "<dataset_id>"
        },
        "includePredictionStatus": false,
        "skipDriftTracking": false,
        "passthroughColumns": null
    },
    "statusDetails": "Job started processing at 2020-02-19 22:41:16.192000",
    "percentageCompleted": 0.0
} 
```

`links.download` プロパティ `https://app.datarobot.com/api/v2/batchPredictions/a1b2c3d4x5y6z7/download/` は、次の手順3のGET呼び出しの特徴量 `<batch_prediction_job_download_url>` です。

### 3. バッチ予測ジョブの結果をダウンロードします。

ジョブのステータスがエラーなしでCOMPLETED（完了）になるまで上記のステータスURLのポーリングを続けます。 この時点で予測をダウンロードできます。

`GET <batch_prediction_job_download_url>`
