Modifs
This commit is contained in:
parent
10a0f3e2d1
commit
45336a94f1
105
EXO5/README.md
105
EXO5/README.md
@ -24,16 +24,39 @@ csvString = csvRead("data.csv",[],[],'string') //ouvre data.csv en une
|
||||
|
||||
> Tracez un nuage de points (salaire,expérience) pour les hommes et les femmes, ainsi que les droites de regression associées. Commentaire ?
|
||||
|
||||
**[Script Scilab](scripts/q1.sce) :**
|
||||
**[Script Scilab - Hommes](scripts/q1-homme.sce) :**
|
||||
|
||||
```scilab
|
||||
...
|
||||
id_male = find(csvString(:,3) == "Male" )
|
||||
salaire_male = csvDouble(id_male,7)
|
||||
exp_male = csvDouble(id_male,6)
|
||||
plot2d(salaire_male,exp_male,-1)
|
||||
[a,b] = reglin(salaire_male',exp_male')
|
||||
y_reg = a*salaire_male+b
|
||||
plot2d(salaire_male,y_reg,5)
|
||||
```
|
||||
|
||||
**[Script Scilab - Femmes](scripts/q1-femme.sce) :**
|
||||
|
||||
```scilab
|
||||
id_female = find(csvString(:,3) == "Female" )
|
||||
salaire_female = csvDouble(id_female,7)
|
||||
exp_female = csvDouble(id_female,6)
|
||||
plot2d(salaire_female,exp_female,-1)
|
||||
[a,b] = reglin(salaire_female',exp_female')
|
||||
y_reg = a*salaire_female+b
|
||||
plot2d(salaire_female,y_reg,5)
|
||||
```
|
||||
|
||||
**Résultat :**
|
||||
|
||||
- Coefficient de corrélation : 0.7280526
|
||||
- ![q1](img/q1.png)
|
||||
- Nuage de points - Hommes :
|
||||
![q1](img/q1-homme.png)
|
||||
|
||||
- Nuage de points - Femmes :
|
||||
![q1](img/q1-femme.png)
|
||||
|
||||
- Commentaire :
|
||||
|
||||
---
|
||||
|
||||
@ -41,16 +64,84 @@ csvString = csvRead("data.csv",[],[],'string') //ouvre data.csv en une
|
||||
|
||||
> Tracez un nuage de points (salaire,expérince) et les droites de regression associées pour chaque niveau d'études. Commentaire ?
|
||||
|
||||
**[Script Scilab](scripts/q2.sce) :**
|
||||
**[Script Scilab - Niveau d'étude n°1](scripts/q2-1.sce) :**
|
||||
|
||||
```scilab
|
||||
...
|
||||
indice_high = find(csvDouble(:,4) == 0 )
|
||||
salaire_high = csvDouble(indice_high,7)
|
||||
exp_high = csvDouble(indice_high,6)
|
||||
plot2d(salaire_high,exp_high,-1)
|
||||
[a,b] = reglin(salaire_high',exp_high')
|
||||
y_reg = a*salaire_high+b
|
||||
plot2d(salaire_high,y_reg,5)
|
||||
```
|
||||
|
||||
**[Script Scilab - Niveau d'étude n°2](scripts/q2-2.sce) :**
|
||||
|
||||
```scilab
|
||||
indice_b = find(csvDouble(:,4) == 1 )
|
||||
salaire_b = csvDouble(indice_b,7)
|
||||
exp_b = csvDouble(indice_b,6)
|
||||
plot2d(salaire_b,exp_b,-1)
|
||||
[a,b] = reglin(salaire_b',exp_b')
|
||||
y_reg = a*salaire_b+b
|
||||
plot2d(salaire_b,y_reg,5)
|
||||
```
|
||||
|
||||
**[Script Scilab - Niveau d'étude n°3](scripts/q2-3.sce) :**
|
||||
|
||||
```scilab
|
||||
indice_m = find(csvDouble(:,4) == 2 )
|
||||
salaire_m = csvDouble(indice_m,7)
|
||||
exp_m = csvDouble(indice_m,6)
|
||||
plot2d(salaire_m,exp_m,-1)
|
||||
[a,b] = reglin(salaire_m',exp_m')
|
||||
y_reg = a*salaire_m+b
|
||||
plot2d(salaire_m,y_reg,5)
|
||||
```
|
||||
|
||||
**[Script Scilab - Niveau d'étude n°4](scripts/q2-4.sce) :**
|
||||
|
||||
```scilab
|
||||
indice_p = find(csvDouble(:,4) == 3)
|
||||
salaire_p = csvDouble(indice_p,7)
|
||||
exp_p = csvDouble(indice_p,6)
|
||||
plot2d(salaire_p,exp_p,-1)
|
||||
[a,b] = reglin(salaire_p',exp_p')
|
||||
y_reg = a*salaire_p+b
|
||||
plot2d(salaire_p,y_reg,5)
|
||||
```
|
||||
|
||||
**Résultat :**
|
||||
|
||||
- ![q2](img/q2.png)
|
||||
<!-- Première paire d'images -->
|
||||
|
||||
<div style="display: flex; justify-content: center;">
|
||||
<div style="margin-right: 20px;">
|
||||
<img src="img/q2-1.png" alt="Nuage de points pour le niveau d'étude n°1" width="400">
|
||||
<p style="text-align: center;">Nuage de points pour le niveau d'étude n°1</p>
|
||||
</div>
|
||||
<div>
|
||||
<img src="img/q2-2.png" alt="Nuage de points pour le niveau d'étude n°2" width="400">
|
||||
<p style="text-align: center;">Nuage de points pour le niveau d'étude n°2</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Deuxième paire d'images -->
|
||||
|
||||
<div style="display: flex; justify-content: center; margin-top: 20px;">
|
||||
<div style="margin-right: 20px;">
|
||||
<img src="img/q2-3.png" alt="Nuage de points pour le niveau d'étude n°3" width="400">
|
||||
<p style="text-align: center;">Nuage de points pour le niveau d'étude n°3</p>
|
||||
</div>
|
||||
<div>
|
||||
<img src="img/q2-4.png" alt="Nuage de points pour le niveau d'étude n°4" width="400">
|
||||
<p style="text-align: center;">Nuage de points pour le niveau d'étude n°4</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
- Commentaires :
|
||||
|
||||
---
|
||||
|
||||
|
BIN
EXO5/img/q1-femme.png
Normal file
BIN
EXO5/img/q1-femme.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 89 KiB |
BIN
EXO5/img/q1-homme.png
Normal file
BIN
EXO5/img/q1-homme.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 94 KiB |
BIN
EXO5/img/q2-1.png
Normal file
BIN
EXO5/img/q2-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 83 KiB |
BIN
EXO5/img/q2-2.png
Normal file
BIN
EXO5/img/q2-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
BIN
EXO5/img/q2-3.png
Normal file
BIN
EXO5/img/q2-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 89 KiB |
BIN
EXO5/img/q2-4.png
Normal file
BIN
EXO5/img/q2-4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
7
EXO5/scripts/q1-femme.sce
Normal file
7
EXO5/scripts/q1-femme.sce
Normal file
@ -0,0 +1,7 @@
|
||||
id_female = find(csvString(:,3) == "Female" )
|
||||
salaire_female = csvDouble(id_female,7)
|
||||
exp_female = csvDouble(id_female,6)
|
||||
plot2d(salaire_female,exp_female,-1)
|
||||
[a,b] = reglin(salaire_female',exp_female')
|
||||
y_reg = a*salaire_female+b
|
||||
plot2d(salaire_female,y_reg,5)
|
7
EXO5/scripts/q1-homme.sce
Normal file
7
EXO5/scripts/q1-homme.sce
Normal file
@ -0,0 +1,7 @@
|
||||
id_male = find(csvString(:,3) == "Male" )
|
||||
salaire_male = csvDouble(id_male,7)
|
||||
exp_male = csvDouble(id_male,6)
|
||||
plot2d(salaire_male,exp_male,-1)
|
||||
[a,b] = reglin(salaire_male',exp_male')
|
||||
y_reg = a*salaire_male+b
|
||||
plot2d(salaire_male,y_reg,5)
|
7
EXO5/scripts/q2-1.sce
Normal file
7
EXO5/scripts/q2-1.sce
Normal file
@ -0,0 +1,7 @@
|
||||
indice_high = find(csvDouble(:,4) == 0 )
|
||||
salaire_high = csvDouble(indice_high,7)
|
||||
exp_high = csvDouble(indice_high,6)
|
||||
plot2d(salaire_high,exp_high,-1)
|
||||
[a,b] = reglin(salaire_high',exp_high')
|
||||
y_reg = a*salaire_high+b
|
||||
plot2d(salaire_high,y_reg,5)
|
7
EXO5/scripts/q2-2.sce
Normal file
7
EXO5/scripts/q2-2.sce
Normal file
@ -0,0 +1,7 @@
|
||||
indice_b = find(csvDouble(:,4) == 1 )
|
||||
salaire_b = csvDouble(indice_b,7)
|
||||
exp_b = csvDouble(indice_b,6)
|
||||
plot2d(salaire_b,exp_b,-1)
|
||||
[a,b] = reglin(salaire_b',exp_b')
|
||||
y_reg = a*salaire_b+b
|
||||
plot2d(salaire_b,y_reg,5)
|
7
EXO5/scripts/q2-3.sce
Normal file
7
EXO5/scripts/q2-3.sce
Normal file
@ -0,0 +1,7 @@
|
||||
indice_m = find(csvDouble(:,4) == 2 )
|
||||
salaire_m = csvDouble(indice_m,7)
|
||||
exp_m = csvDouble(indice_m,6)
|
||||
plot2d(salaire_m,exp_m,-1)
|
||||
[a,b] = reglin(salaire_m',exp_m')
|
||||
y_reg = a*salaire_m+b
|
||||
plot2d(salaire_m,y_reg,5)
|
7
EXO5/scripts/q2-4.sce
Normal file
7
EXO5/scripts/q2-4.sce
Normal file
@ -0,0 +1,7 @@
|
||||
indice_p = find(csvDouble(:,4) == 3)
|
||||
salaire_p = csvDouble(indice_p,7)
|
||||
exp_p = csvDouble(indice_p,6)
|
||||
plot2d(salaire_p,exp_p,-1)
|
||||
[a,b] = reglin(salaire_p',exp_p')
|
||||
y_reg = a*salaire_p+b
|
||||
plot2d(salaire_p,y_reg,5)
|
Loading…
Reference in New Issue
Block a user