Exercise

# Eager runners

In this exercise, you're going to build a model of the starting position of a runner in the Cherry Blossom race as a function of `age`

, `sex`

, and `nruns`

.

```
model_1 <- rpart(start_position ~ age + sex + nruns,
data = Runners, cp = 0.001)
```

Then, you'll evaluate the model in two different ways:

```
as_class <- evaluate_model(model_1, type = "class")
as_prob <- evaluate_model(model_1)
```

The second evaluation (`as_prob`

) gives the probability assigned by the model to each class. Note that for each set of inputs, the probabilities add to 1.

How do the probabilities in `as_prob`

relate to the class selected in `as_class`

?

Instructions

**50 XP**

##### Possible Answers

- The class assigned is the one with probability greater than 50%.
- The class assigned is the one with larger probability than the others.
- The class is assigned randomly, making a draw from the probabilities.