> ## 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.

# is_missing

> Check for missing values in a given column. 

This step checks each row of the input column to determine if the value is missing (null or NaN).
The result is a new boolean column, where each row indicates whether the corresponding element
in the input column is missing.

The step can work with single-valued and multi-valued columns, and the output can be configured
to be either boolean (true/false), numeric (0/1) or categorical (custom labels).

* For single-valued columns: Each row in the output column will be `true` if the corresponding
  value in the input column is missing, and `false` otherwise.
* For multivalued columns: Each row in the output column will be `true` if the corresponding
  sub-list in the input column is empty, and `false` otherwise.

## 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">
      Check for missing values in a numeric column.

      ```stan theme={null}
      is_missing(ds.numeric_col) -> (ds.numeric_col_missing)
      ```
    </Tab>

    <Tab title="Example 2">
      Check for missing values in a text column and set output type to numeric.

      ```stan theme={null}
      is_missing(ds.string_col, {"out_type": "number"}) -> (ds.string_col_missing)
      ```
    </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}
      is_missing(column: column, {
          "param": value,
          ...
      }) -> (result: column)
      ```
    </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="column" type="column" required>
    The input column to check for missing values.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket">
  <ParamField path="result" type="column" required>
    The output column indicating the presence of missing values in the input column.
  </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="out_type" type="string" default="boolean">
    Output type.
    The data type of the output column.

    * 'boolean': Output is true/false indicating missing or not.
    * 'number': Output is 0/1 indicating missing or not.
    * 'category': Output is specified by params\["labels"]\["true"] and params\["labels"]\["false"].

    Values must be one of the following:

    * `boolean`
    * `number`
    * `category`
  </ParamField>

  <ParamField path="labels" type="object">
    Labels for the true and false categories.
    An object mapping the "true" and "false" categories to custom labels.

    <Accordion title="Properties">
      <ParamField path="true" type="string" default="true">
        Label for the "true" category.
      </ParamField>

      <ParamField path="false" type="string" default="false">
        Label for the "false" category.
      </ParamField>
    </Accordion>
  </ParamField>
</Accordion>
