We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0de3f5 commit 7c91928Copy full SHA for 7c91928
inst/shiny/C03Ca_ml_wine/app.R
@@ -57,8 +57,11 @@ score_model <- function(x, reference = wine2quality) {
57
c("autre", "excellent")[(as.character(x) == "excellent") + 1]
58
wine_true2 <-
59
c("autre", "excellent")[(as.character(reference) == "excellent") + 1]
60
+ # If there is no excellent in the result, the model is rejected
61
+ if (!sum(wine_true2 == "excellent"))
62
+ return(structure(NA,
63
+ message = "Il faut classer au moins un vin dans 'excellent', or il n'y en a aucun dans votre solution. Corrigez et resoumettez !"))
64
res <- summary(confusion(as.factor(wine_pred2), as.factor(wine_true2)))
- #res
65
# Precision for 'excellent' must by higher than 25%
66
prec <- res["excellent", "Precision"]
67
if (prec < 0.25)
0 commit comments