This commit is contained in:
stiti 2024-06-12 20:45:45 +02:00
parent 6d799b5bcc
commit 21d2cd0853
11 changed files with 81 additions and 65 deletions

View File

@ -17,9 +17,8 @@ Pour cette exercice, veuillez initaliser les variables suivantes :
**[Script Scilab](scripts/init.sce) :** **[Script Scilab](scripts/init.sce) :**
```scilab ```scilab
D = csvRead('data.csv'); csvDouble = csvRead("data.csv") //ouvre data.csv en une matrice d'entier
DD = csvRead('data.csv',',','.','string'); csvString = csvRead("data.csv",[],[],'string') //ouvre data.csv en une matrice de string
genre = DD(:,3);
``` ```
--- ---
@ -31,10 +30,8 @@ genre = DD(:,3);
**[Script Scilab](scripts/q1.sce) :** **[Script Scilab](scripts/q1.sce) :**
```scilab ```scilab
age = D(:, 2); ages = tabul(csvDouble(:,2))
min_age = min(age); bar(ages(:,1),ages(:,2))
max_age = max(age);
histplot(41,age);
``` ```
**Résultat :** **Résultat :**
@ -50,10 +47,8 @@ histplot(41,age);
**[Script Scilab](scripts/q2.sce) :** **[Script Scilab](scripts/q2.sce) :**
```scilab ```scilab
exp = D(:,6); exp = tabul(csvDouble(:,6))
min_xp = min(exp); bar(exp(:,1),exp(:,2))
max_xp = max(exp);
histplot(34,exp);
``` ```
**Résultat :** **Résultat :**
@ -69,19 +64,18 @@ histplot(34,exp);
**[Script Scilab](scripts/q3.sce) :** **[Script Scilab](scripts/q3.sce) :**
```scilab ```scilab
Q = quart(age) mean(csvDouble(:,2)) //moyenne
IQR = Q(3) - Q(1) min(csvDouble(:,2)) //min
min_age = min(age); max(csvDouble(:,2)) //max
max_age = max(age); median(csvDouble(:,2)) //médianne
mean(age) quart(csvDouble(:,2)) //quartile
median(age) iqr(csvDouble(:,2)) //interquartile
stdev(csvDouble(:,2)) //ecart-type
unique_vals = unique(age); age = tabul(csvDouble(:,2))
freq = histc(ages, unique_vals); [occurence_tri,indice_tri] = gsort(age(:,2))
[max_freq, max_index] = max(freq); liste_age = age(:,1)
age_mode = unique_vals(max_index); mode = liste_age(35) //mode
stdev(age)
``` ```
**Résultat :** **Résultat :**
@ -91,7 +85,7 @@ stdev(age)
- Maximum : 62 - Maximum : 62
- Moyenne : 33.622033 - Moyenne : 33.622033
- Médiane : 32 - Médiane : 32
- Mode : 26 - Mode : 27
- Écart type de l'âge : 7.6156456 - Écart type de l'âge : 7.6156456
--- ---
@ -103,7 +97,14 @@ stdev(age)
**[Script Scilab](scripts/q4.sce) :** **[Script Scilab](scripts/q4.sce) :**
```scilab ```scilab
boxplot(age); // Installation de stibox
atomsInstall("stixbox")
// Lancement de stibox
atomsLoad("stixbox")
// Utilisation de stibox
boxplot(csvDouble(:,2),"whisker",0.25,"orientation","horizontal")
``` ```
**Résultat :** **Résultat :**
@ -118,22 +119,22 @@ boxplot(age);
**[Script Scilab](scripts/q5.sce) :** **[Script Scilab](scripts/q5.sce) :**
```scilab ```scilab
Q = quart(exp) mean(csvDouble(:,6)) //moyenne
IQR = Q(3) - Q(1) min(csvDouble(:,6)) //min
min_xp = min(exp); max(csvDouble(:,6)) //max
max_xp = max(exp); median(csvDouble(:,6)) //médianne
mean(exp) quart(csvDouble(:,6)) //quartile
median(exp) iqr(csvDouble(:,6)) //interquartile
stdev(csvDouble(:,6)) //ecart-type
Unique_vals = unique(exp); exp = tabul(csvDouble(:,6))
Freq = histc(exp, Unique_vals); [occurence_tri,indice_tri] = gsort(exp(:,2))
[max_Freq, max_Index] = max(Freq); liste_exp = exp(:,1)
exp_mode = Unique_vals(max_Index); mode = liste_exp(33) //mode
stdev(exp) atomsInstall("stixbox")
atomsLoad("stixbox")
boxplot(csvDouble(:,6),"whisker",0.25,"orientation","horizontal")
boxplot(exp);
``` ```
**Résultat :** **Résultat :**
@ -143,7 +144,7 @@ boxplot(exp);
- Maximum : 34 - Maximum : 34
- Moyenne : 8.0950142 - Moyenne : 8.0950142
- Médiane : 7 - Médiane : 7
- Mode : 1.5 - Mode : 2
- Écart type : 6.0598534 - Écart type : 6.0598534
- -

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -1,3 +1,2 @@
D = csvRead('data.csv'); csvDouble = csvRead("data.csv") //ouvre data.csv en une matrice d'entier
DD = csvRead('data.csv',',','.','string'); csvString = csvRead("data.csv",[],[],'string') //ouvre data.csv en une matrice de string
genre = DD(:,3);

View File

@ -1,4 +1,2 @@
age = D(:, 2); ages = tabul(csvDouble(:,2))
min_age = min(age); bar(ages(:,1),ages(:,2))
max_age = max(age);
histplot(41,age);

View File

@ -1,4 +1,2 @@
exp = D(:,6); exp = tabul(csvDouble(:,6))
min_xp = min(exp); bar(exp(:,1),exp(:,2))
max_xp = max(exp);
histplot(34,exp);

View File

@ -0,0 +1,12 @@
mean(csvDouble(:,2)) //moyenne
min(csvDouble(:,2)) //min
max(csvDouble(:,2)) //max
median(csvDouble(:,2)) //médianne
quart(csvDouble(:,2)) //quartile
iqr(csvDouble(:,2)) //interquartile
stdev(csvDouble(:,2)) //ecart-type
age = tabul(csvDouble(:,2))
[occurence_tri,indice_tri] = gsort(age(:,2))
liste_age = age(:,1)
mode = liste_age(35) //mode

View File

@ -1 +1,8 @@
boxplot(age); // Installation de stibox
atomsInstall("stixbox")
// Lancement de stibox
atomsLoad("stixbox")
// Utilisation de stibox
boxplot(csvDouble(:,2),"whisker",0.25,"orientation","horizontal")

View File

@ -1,15 +1,16 @@
Q = quart(exp) mean(csvDouble(:,6)) //moyenne
IQR = Q(3) - Q(1) min(csvDouble(:,6)) //min
min_xp = min(exp); max(csvDouble(:,6)) //max
max_xp = max(exp); median(csvDouble(:,6)) //médianne
mean(exp) quart(csvDouble(:,6)) //quartile
median(exp) iqr(csvDouble(:,6)) //interquartile
stdev(csvDouble(:,6)) //ecart-type
Unique_vals = unique(exp); exp = tabul(csvDouble(:,6))
Freq = histc(exp, Unique_vals); [occurence_tri,indice_tri] = gsort(exp(:,2))
[max_Freq, max_Index] = max(Freq); liste_exp = exp(:,1)
exp_mode = Unique_vals(max_Index); mode = liste_exp(33) //mode
stdev(exp) atomsInstall("stixbox")
atomsLoad("stixbox")
boxplot(exp); boxplot(csvDouble(:,6),"whisker",0.25,"orientation","horizontal")