For *doctoral students*: for the lab sessions, please come to the IMMAC sessions (group `5PMSAST6_2021_S9_BE_G2` with [ADE](https://edt.grenoble-inp.fr/2021-2022/exterieur/))
For *doctoral or erasmus students*: for the lab sessions, please come to the IMMAC sessions (group `5PMSAST6_2021_S9_BE_G2` with [ADE](https://edt.grenoble-inp.fr/2021-2022/exterieur/))
This notebook can be run on mybinder: [](https://mybinder.org/v2/git/https%3A%2F%2Fgricad-gitlab.univ-grenoble-alpes.fr%2Fchatelaf%2Fml-sicom3a/master?filepath=notebooks%2F/1_introduction/N1_Linear_Classification.ipynb)
%% Cell type:code id: tags:
``` python
# Import modules
%matplotlibinline
importmatplotlib
importnumpyasnp
importscipyassp
importmatplotlib.pyplotasplt
```
%% Cell type:code id: tags:
``` python
# Select random seed
random_state=0
```
%% Cell type:markdown id: tags:
We use scikit-learn to generate a toy 2D data set (two features $x_1$ and $x_2$) for binary classification (two classes)
- each sample $(x_1,x_2)$ in the dataset is plotted as a 2D point where the two features $x_1$ and $x_2$ are displayed along the abscissa and ordinate axes respectively
- the corresponding class label $y$ is displayed as a color mark (e.g., yellow or purple)
%% Cell type:code id: tags:
``` python
fromsklearn.datasetsimportmake_classification
#X are the features (aka inputs, ...), y the labels (aka responses, targets, output...)
Change the number of informative features from `n_informative=2̀` to `n_informative=1` in the `make_classification()` procedure, regenerate the data set and fit the classification rule. Interpret now the new decision boundary: are the two variables of equal importance in predicting the class of the data?
%% Cell type:code id: tags:
``` python
#get the documentation for sklearn RidgeClassification object