mirror of
https://github.com/ArthurDanjou/ArtStudies.git
synced 2026-01-31 08:29:26 +01:00
fix confusion matrix
This commit is contained in:
@@ -84,12 +84,11 @@ model_train_pima <- glm(type ~ npreg + glu + bp + skin + bmi + ped + age, data =
|
|||||||
summary(model_train_pima)
|
summary(model_train_pima)
|
||||||
```
|
```
|
||||||
```{r}
|
```{r}
|
||||||
|
|
||||||
pima.te$pred <- predict(model_train_pima, newdata = pima.te, type = "response")
|
pima.te$pred <- predict(model_train_pima, newdata = pima.te, type = "response")
|
||||||
pima.te$pred <- ifelse(pima.te$pred > 0.5, "Yes", "No")
|
pima.te$pred <- ifelse(pima.te$pred > 0.55, "Yes", "No")
|
||||||
pima.te$pred <- as.factor(pima.te$pred)
|
pima.te$pred <- as.factor(pima.te$pred)
|
||||||
pima.te$type <- as.factor(pima.te$type)
|
pima.te$type <- as.factor(pima.te$type)
|
||||||
|
|
||||||
# Confusion matrix
|
# Confusion matrix
|
||||||
confusionMatrix(data = pima.te$type, reference = pima.te$pred)
|
confusionMatrix(data = pima.te$type, reference = pima.te$pred, positive = 'Yes')
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user