---
name: "mlpack_preprocess_one_hot_encoding"
section: "1"
platform: "linux"
package: "mlpack-bin"
version: "4.6.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_preprocess_one_hot_encoding"
---

# mlpack\_preprocess\_one\_hot\_encoding(1)

one hot encoding

## NAME

**mlpack\_preprocess\_one\_hot\_encoding** - one hot encoding

## SYNOPSIS

```
 mlpack_preprocess_one_hot_encoding -i string [-d vector] [-V bool] [-o unknown] [-h -v]
```

## DESCRIPTION

This utility takes a dataset and a *vector* of indices and does one-hot encoding of the respective features at those indices. Indices represent the IDs of the dimensions to be one-hot encoded.

If no dimensions are specified with '**--dimensions** (**-d**)', then all categorical-type dimensions will be one-hot encoded. Otherwise, only the dimensions given in '**--dimensions** (**-d**)' will be one-hot encoded.

The output matrix with encoded features may be saved with the '**--output\_file** (**-o**)' parameters.

So, a simple example where we want to encode 1st and 3rd feature from dataset ’X.csv' into 'X\_output.csv' would be

$ **mlpack\_preprocess\_one\_hot\_encoding** **--input\_file** X.arff **--output\_file** X\_ouput.csv **--dimensions** 1 **--dimensions** 3

## REQUIRED INPUT OPTIONS

- **--input\_file (-i) \[*string*\]**

  Matrix containing data.

## OPTIONAL INPUT OPTIONS

- **--dimensions (-d) \[*vector*\]**

  Index of dimensions that need to be one-hot encoded (if unspecified, all categorical dimensions are one-hot encoded). Default value \[\].

- **--help (-h) \[*bool*\]**

  Default help info.

- **--info \[*string*\]**

  Print help on a specific option. Default value ''.

- **--verbose (-v) \[*bool*\]**

  Display informational messages and the full list of parameters and timers at the end of execution.

- **--version (-V) \[*bool*\]**

  Display the version of mlpack.

## OPTIONAL OUTPUT OPTIONS

**--output\_file** (**-o**) \[*unknown*\] Matrix to save one-hot encoded features data to.

## ADDITIONAL INFORMATION

For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.
