> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# normalize

> Normalizes a numerical column by subtracting the mean and dividing by its standard deviation. 

The resulting column's values will have a mean of 0.0 and a standard deviation of 1.0.
Both types of scaling can be toggled separately via the `with_mean` and `with_std` parameters.

## Usage

The following examples show how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      To normalize using both mean and standard deviation:

      ```stan theme={null}
      normalize(ds.input) -> (ds.normalized)
      ```
    </Tab>

    <Tab title="Example 2">
      Using a custom configuration to only subtract the mean:

      ```stan theme={null}
      normalize(ds.input, {
        "with_mean": true,
        "with_std": false,
      }) -> (ds.normalized)
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      normalize(input: number, {
          "param": value,
          ...
      }) -> (output: number)
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="input" type="column[number]" required>
    A numeric column to normalize.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="output" type="column[number]" required>
    A numeric column containing the normalized value.
  </ParamField>
</Accordion>

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="with_mean" type="boolean" default="true">
    Whether to subtract the mean.
  </ParamField>

  <ParamField path="with_std" type="boolean" default="true">
    Whether to divide by the standard deviation.
  </ParamField>
</Accordion>
