Description Usage Arguments Value See Also Examples

Given a Task, creates a model for the learning machine which can be used for predictions on new data.

1 |

`learner` |
(Learner | |

`task` |
(Task) |

`subset` |
(integer | logical | |

`weights` |
(numeric) |

(WrappedModel).

predict.WrappedModel

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
training.set = sample(seq_len(nrow(iris)), nrow(iris) / 2)
## use linear discriminant analysis to classify iris data
task = makeClassifTask(data = iris, target = "Species")
learner = makeLearner("classif.lda", method = "mle")
mod = train(learner, task, subset = training.set)
print(mod)
## use random forest to classify iris data
task = makeClassifTask(data = iris, target = "Species")
learner = makeLearner("classif.rpart", minsplit = 7, predict.type = "prob")
mod = train(learner, task, subset = training.set)
print(mod)
``` |

```
Loading required package: ParamHelpers
Model for learner.id=classif.lda; learner.class=classif.lda
Trained on: task.id = iris; obs = 75; features = 4
Hyperparameters: method=mle
Model for learner.id=classif.rpart; learner.class=classif.rpart
Trained on: task.id = iris; obs = 75; features = 4
Hyperparameters: xval=0,minsplit=7
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.