@@ -4,7 +4,7 @@ author: "Guyliann Engels & Philippe Grosjean"
44description : " **SDD III** Exercices sur les matrices de confusion."
55tutorial :
66 id : " C01La_confusion"
7- version : 1.0 .0/4
7+ version : 1.1 .0/4
88output :
99 learnr::tutorial :
1010 progressive : true
@@ -37,9 +37,9 @@ BioDataScience3::learnr_server(input, output, session)
3737
3838``` {r, echo=FALSE, message=FALSE}
3939data.frame(
40- "A" = c( 25 , 0, 1 ),
41- "B" = c(0, 16, 9 ),
42- "C" = c(0,8, 18 ),
40+ "A" = c(250 , 0, 10 ),
41+ "B" = c(0, 160, 90 ),
42+ "C" = c(0, 80, 180 ),
4343 row.names = c("A", "B", "C")) %>.%
4444 knitr::kable(., caption = "Matrice de confusion dont les colonnes représentent la classification par ordinateur et les lignes la classification manuelle.")
4545```
5757```
5858
5959``` {r conf1_h2-hint-1}
60- tp <- 16
61- fp <- 9
62- fn <- 8
63- tn <- 44
60+ tp <- 160
61+ fp <- 90
62+ fn <- 80
63+ tn <- 440
6464# calcul de la matrice
6565conf <- ___
6666conf
6969
7070``` {r conf1_h2-solution}
7171## Solution ##
72- tp <- 16
73- fp <- 9
74- fn <- 8
75- tn <- 44
72+ tp <- 160
73+ fp <- 90
74+ fn <- 80
75+ tn <- 440
7676# calcul de la matrice
7777conf <- (tp+tn)/(tp+fp+fn+tn)
7878conf
7979```
8080
8181``` {r conf1_h2-check}
8282grade_result(
83- pass_if(~ identical(.result, ((16+44 )/(16+9+8+44 ))), "Bien joué !")
83+ pass_if(~ identical(.result, ((160+440 )/(160+90+80+440 ))), "Bien joué !")
8484)
8585```
8686
8787### La taux de vrai positif
8888
8989``` {r, echo=FALSE, message=FALSE}
9090data.frame(
91- "A" = c( 9, 4, 1 ),
92- "B" = c(0, 6, 9 ),
93- "C" = c(0,1, 14 ),
91+ "A" = c(90, 40, 10 ),
92+ "B" = c(0, 60, 90 ),
93+ "C" = c(0, 10, 140 ),
9494 row.names = c("A", "B", "C")) %>.%
9595 knitr::kable(., caption = "Matrice de confusion dont les colonnes représentent la classification par ordinateur et les lignes la classification manuelle.")
9696```
@@ -108,10 +108,10 @@ conf
108108```
109109
110110``` {r conf2_h2-hint-1}
111- tp <- 14
112- fp <- 1
113- fn <- 10
114- tn <- 19
111+ tp <- 140
112+ fp <- 10
113+ fn <- 100
114+ tn <- 190
115115# calcul de la matrice
116116conf <- ___
117117conf
@@ -120,28 +120,28 @@ conf
120120
121121``` {r conf2_h2-solution}
122122## Solution ##
123- tp <- 14
124- fp <- 1
125- fn <- 10
126- tn <- 19
123+ tp <- 140
124+ fp <- 10
125+ fn <- 100
126+ tn <- 190
127127# calcul de la matrice
128128conf <- (tp)/(tp+fn)
129129conf
130130```
131131
132132``` {r conf2_h2-check}
133133grade_result(
134- pass_if(~ identical(.result, (14/(14 + 10 ))), "Bien joué !")
134+ pass_if(~ identical(.result, (140/(140 + 100 ))), "Bien joué !")
135135)
136136```
137137
138138### La spécificité
139139
140140``` {r, echo=FALSE, message=FALSE}
141141data.frame(
142- "A" = c( 9, 4, 1 ),
143- "B" = c(0, 6, 9 ),
144- "C" = c(0,1, 14 ),
142+ "A" = c(90, 40, 10 ),
143+ "B" = c(0, 60, 90 ),
144+ "C" = c(0, 10, 140 ),
145145 row.names = c("A", "B", "C")) %>.%
146146 knitr::kable(., caption = "Matrice de confusion dont les colonnes représentent la classification par ordinateur et les lignes la classification manuelle.")
147147```
@@ -159,10 +159,10 @@ conf
159159```
160160
161161``` {r conf3_h2-hint-1}
162- tp <- 9
163- fp <- 5
162+ tp <- 90
163+ fp <- 50
164164fn <- 0
165- tn <- 30
165+ tn <- 300
166166# calcul de la matrice
167167conf <- ___
168168conf
@@ -171,28 +171,28 @@ conf
171171
172172``` {r conf3_h2-solution}
173173## Solution ##
174- tp <- 9
175- fp <- 5
174+ tp <- 90
175+ fp <- 50
176176fn <- 0
177- tn <- 30
177+ tn <- 300
178178# calcul de la matrice
179179conf <- (tn)/(tn+fp)
180180conf
181181```
182182
183183``` {r conf3_h2-check}
184184grade_result(
185- pass_if(~ identical(.result, (30/(30 + 5 ))), "Bien joué !")
185+ pass_if(~ identical(.result, (300/(300 + 50 ))), "Bien joué !")
186186)
187187```
188188
189189### La précision
190190
191191``` {r, echo=FALSE, message=FALSE}
192192data.frame(
193- "A" = c(10, 3, 2 ),
194- "B" = c(0, 0, 15 ),
195- "C" = c(3, 1, 11 ),
193+ "A" = c(100, 30, 20 ),
194+ "B" = c(0, 10, 150 ),
195+ "C" = c(30, 20, 110 ),
196196 row.names = c("A", "B", "C")) %>.%
197197 knitr::kable(., caption = "Matrice de confusion dont les colonnes représentent la classification par ordinateur et les lignes la classification manuelle.")
198198```
@@ -210,10 +210,10 @@ conf
210210```
211211
212212``` {r conf4_h2-hint-1}
213- tp <- 15
214- fp <- 0
215- fn <- 13
216- tn <- 17
213+ tp <- 10
214+ fp <- 150
215+ fn <- 30
216+ tn <- 260
217217# calcul de la matrice
218218conf <- ___
219219conf
@@ -222,18 +222,18 @@ conf
222222
223223``` {r conf4_h2-solution}
224224## Solution ##
225- tp <- 15
226- fp <- 0
227- fn <- 13
228- tn <- 17
225+ tp <- 10
226+ fp <- 150
227+ fn <- 30
228+ tn <- 260
229229# calcul de la matrice
230230conf <- (tp)/(tp+fp)
231231conf
232232```
233233
234234``` {r conf4_h2-check}
235235grade_result(
236- pass_if(~ identical(.result, (15/(15+0 ))), "Bien joué !")
236+ pass_if(~ identical(.result, (10/(10+150 ))), "Bien joué !")
237237)
238238```
239239
0 commit comments