# createGrid

From caret v3.21
by Max Kuhn

##### Tuning Parameter Grid

This function creates a data frame that contains a grid of complexity parameters specific methods.

- Keywords
- utilities

##### Usage

`createGrid(method, len = 3, data = NULL)`

##### Arguments

- method
- a string specifying which classification model to use. Possible values are:
`lm`

,`rda`

,`lda`

,`gbm`

,`rf`

,`nnet`

,`multinom`

,`gpls`

,`lvq`

,`rpart`

- len
- an integer specifying the number of points on the grid for each tuning parameter.
- data
- the training data (only needed in the case where the
`method`

is`cforest`

,`earth`

,`bagEarth`

,`fda`

,`bagFDA`

,`rpart`

,`rf`

or`pls`

.

##### Details

A grid is created with rows corresponding to complexity parameter combinations. If the model does not use tuning parameters (like a linear model), values of `NA`

are returned. Columns are named the same as the parameter name, but preceded by a period.

For some models, the data should be passed to the function via the `data`

argument. In these cases, the outcome should be included in a column named `.outcome`

.

##### Value

- A data frame where the rows are combinations of tuning parameters and columns correspond to the parameters. The column names should be the parameter names preceded by a dot (e.g.
`.mtry`

)

##### See Also

##### Examples

```
createGrid("rda", 4)
createGrid("lm")
createGrid("nnet")
```

*Documentation reproduced from package caret, version 3.21, License: GPL-2*

### Community examples

Looks like there are no examples yet.