R: Data preparator for LightGBM datasets with rules (integer)

lgb.prepare_rules2 {lightgbm} | R Documentation

## Data preparator for LightGBM datasets with rules (integer)

### Description

Attempts to prepare a clean dataset to prepare to put in a `lgb.Dataset`. Factors and characters are converted to numeric (specifically: integer). In addition, keeps rules created so you can convert other datasets using this converter. This is useful if you have a specific need for integer dataset instead of numeric dataset. Note that there are programs which do not support integer-only input. Consider this as a half memory technique which is dangerous, especially for LightGBM.

### Usage

    lgb.prepare_rules2(data, rules = NULL)

### Arguments

`data` | A data.frame or data.table to prepare.
`rules` | A set of rules from the data preparator, if already used.

### Value

A list with the cleaned dataset (`data`) and the rules (`rules`). The data must be converted to a matrix format (`as.matrix`) for input in `lgb.Dataset`.

[Package lightgbm version 2.3.1 Index]