# カスタムモデルのランタイムパラメーター

> カスタムモデルのランタイムパラメーター - カスタムタスクのハイパーパラメーターを定義します。

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

## Primary page

- [カスタムモデルのランタイムパラメーター](https://docs.datarobot.com/ja/docs/classic-ui/modeling/automl-preview/cml-hyperparam.html.md): Full documentation for this topic (Markdown sidecar).

## Documentation content

> [!NOTE] 本機能の提供について
> カスタムタスクのハイパーパラメーターは、デフォルトでオフになっています。 この機能を有効にする方法については、DataRobotの担当者または管理者にお問い合わせください。
> 
> カスタムタスクのハイパーパラメーターを有効にする

プレビューで使用できるようになったため、カスタムタスクのハイパーパラメーターを定義できます。 [model-metadata.yaml](https://docs.datarobot.com/ja/docs/classic-ui/modeling/special-workflows/cml/cml-custom-tasks.html.md#model-metadatayaml) ファイルでハイパーパラメーターを追加および設定します。

`name` と `type` の各ハイパーパラメーターに、2つの値を指定する必要があります。 タイプは、 `int` 、 `float` 、 `string` 、 `select` 、または `multi` のいずれかです。 すべてのタイプが、 `default` 値をサポートします。 整数値と浮動小数点値には、 `min` 値と `max` 値を指定できます。 特定タイプのパラメーターでは、 `values` フィールドのリストを必要とし、許容される値を定義します。 文字列型のハイパーパラメーターは、任意の文字列を受け入れ可能です。 マルチタイプには、 `float` および `select` などの前述のタイプの複数として指定された値があります。

以下のハイパーパラメーターのサンプルセットを表示します。

```
hyperparameters:
  # int: Integer value, must provide a min and max. Default is optional. Uses the min value if not provided.
  - name: seed
    type: int
    min: 0
    max: 10000
    default: 64
  # int: Integer value, must provide a min and max. Default is optional. Uses the min value if not provided.
  - name: kbins_n_bins
    type: int
    min: 2
    max: 1000
    default: 10
  # select: A discrete set of unique values, similar to an enum. Default is optional. Will use the first value if
  # not provided.
  - name: kbins_strategy
    type: select
    values:
      - uniform
      - quantile
      - kmeans
    default: quantile
  # multi: A parameter that can be of multiple types (int/float/select). Default is optional. Will use the first parameter
  # type's default value. This example uses select, the first entry, or for int/float, the min value.
  - name: missing_values_strategy
    type: multi
    values:
      float:
        min: -1000000.0
        max: 1000000.0
      select:
        values:
        - median
        - mean
        - most_frequent
    default: median
  # string: Unicode string. Default is optional. Is an empty string if not provided.
  - name: print_message
    type: string
    default: "hello world 🚀" 
```

以下に示すように、 `fit` メソッドを通してカスタムタスクのハイパーパラメーターにアクセスし、 `fit` 関数引数にパラメーターを追加します。

```
def fit(
    X: pd.DataFrame,
    y: pd.Series,
    output_dir: str,
    class_order: Optional[List[str]] = None,
    row_weights: Optional[np.ndarray] = None,
    parameters: Optional[dict] = None,
    **kwargs,
): 
```
