# 時系列

> 時系列 - 時系列モデルのバッチ予測の設定方法について概説します。設定の詳細とコード例を掲載しています。

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.260183+00:00` (UTC).

## Primary page

- [時系列](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/batch-pred-ts.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [時系列バッチ予測の設定](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/batch-pred-ts.html.md#time-series-batch-prediction-settings): In-page section heading.
- [予測タイプ](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/batch-pred-ts.html.md#prediction-type): In-page section heading.
- [スコアリングデータセットの要件](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/batch-pred-ts.html.md#requirements-for-the-scoring-dataset): In-page section heading.
- [単一系列の予測データセットの例](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/batch-pred-ts.html.md#single-series-forecast-dataset-example): In-page section heading.
- [複数系列予測データセット例](https://docs.datarobot.com/ja/docs/api/reference/batch-prediction-api/batch-pred-ts.html.md#multiseries-forecast-dataset-example): In-page section heading.

## Documentation content

時系列モデルのバッチ予測は、追加の設定なしで機能します。 ただし、ほとんどの場合はデフォルト設定を変更するか、予測データセットを準備する必要があります。

## 時系列バッチ予測の設定

デフォルト設定は、 `timeseriesSettings` ジョブ設定プロパティを使用してオーバーライドできます。

| パラメーター | 例 | 説明 |
| --- | --- | --- |
| type | forecast | forecast（デフォルト）またはhistoricalのいずれかである必要があります。 |
| forecastPoint | 2019-02-04T00:00:00Z | （オプション）デフォルトで、DataRobotはデータセットから予想ポイントを推測します。 設定するには、typeをforecastに設定する必要があります。 |
| predictionsStartDate | 2019-01-04T00:00:00Z | （オプション）デフォルトで、DataRobotはデータセットから開始日を推測します。 設定するには、typeをhistoricalに設定する必要があります。 |
| predictionsEndDate | 2019-02-04T00:00:00Z | （オプション）デフォルトで、DataRobotはデータセットから終了日を推測します。 設定するには、typeをhistoricalに設定する必要があります。 |
| relaxKnownInAdvanceFeaturesCheck | false | （オプション）アクティブ化すると、事前に既知の欠損値特徴量を予測時に予想ウィンドウで使用できます。 省略するかfalseの場合、欠損値は使用できません。 デフォルト：false。 |

完全なジョブの例を以下に示します。

```
{
    "deploymentId": "5f22ba7ade0f435ba7217bcf",
    "intakeSettings": {"type": "localFile"},
    "outputSettings": {"type": "localFile"},
    "timeseriesSettings": {
        "type": "historical",
        "predictionsStartDate": "2020-01-01",
        "predictionsEndDate": "2020-03-31"
    }
} 
```

Python APIクライアントの使用例：

```
import datarobot as dr

dr.Client(
    endpoint="https://app.datarobot.com/api/v2",
    token="...",
)

deployment_id = "..."

input_file = "to_predict.csv"
output_file = "predicted.csv"

job = dr.BatchPredictionJob.score_to_file(
    deployment_id,
    input_file,
    output_file,
    timeseries_settings={
        "type": "historical",
        "predictions_start_date": "2020-01-01",
        "predictions_end_date": "2020-03-31",
    },
)

print("started scoring...", job)
job.wait_for_completion() 
```

## 予測タイプ

`forecast` モードを使用する場合は、DataRobotはターゲットなしで、データセットの `forecastPoint` または行を使用して予測します。 `historical` モードの場合は、DataRobotは一括予測を有効化し、 `predictionsStartDate` と `predictionsEndDate` の範囲内の可能なすべての予想ポイントと予想距離を予測します。

## スコアリングデータセットの要件

バッチ予測APIで時系列データセットを処理するには、以下を設定する必要があります。

- 予測行をタイムスタンプでソートします。最も古い行が最初に表示されます。
- DataRobotがサポートする系列の数には 制限はありません 。 制限 に記載されているように、唯一の制限はジョブのタイムアウトです。

### 単一系列の予測データセットの例

単一系列の予測データセットの例を以下に示します。

| 日付 | y |
| --- | --- |
| 2020-01-01 | 9342.85 |
| 2020-01-02 | 4951.33 |
| 24の追加の過去の行 |  |
| 2020-01-27 | 4180.92 |
| 2020-01-28 | 5943.11 |
| 2020-01-29 |  |
| 2020-01-30 |  |
| 2020-01-31 |  |
| 2020-02-01 |  |
| 2020-02-02 |  |
| 2020-02-03 |  |
| 2020-02-04 |  |

### 複数系列予測データセット例

複数の系列をスコアリングする場合、データは系列とタイムスタンプでソートする必要があります。

| 日付 | 系列 | y |
| --- | --- | --- |
| 2020-01-01 | A | 9342.85 |
| 2020-01-02 | A | 4951.33 |
| 24の追加の過去の行 |  |  |
| 2020-01-27 | A | 4180.92 |
| 2020-01-28 | A | 5943.11 |
| 2020-01-29 | A |  |
| 2020-01-30 | A |  |
| 2020-01-31 | A |  |
| 2020-02-01 | A |  |
| 2020-02-02 | A |  |
| 2020-02-03 | A |  |
| 2020-02-04 | A |  |
| 2020-01-01 | B | 8477.22 |
| 2020-01-02 | B | 7210.29 |
| 24の追加の過去の行 |  |  |
| 2020-01-27 | B | 7400.21 |
| 2020-01-28 | B | 8844.71 |
| 2020-01-29 | B |  |
| 2020-01-30 | B |  |
| 2020-01-31 | B |  |
| 2020-02-01 | B |  |
| 2020-02-02 | B |  |
| 2020-02-03 | B |  |
| 2020-02-04 | B |  |
