mirror of https://github.com/01-edu/Branch-AI.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
910 B
16 lines
910 B
2 years ago
|
# Exercise 3: Train test split
|
||
|
|
||
|
The goal of this exercise is to learn to split a data set. It is important to understand why we split the data in two sets. To put it in a nutshell: the Machine Learning model learns on the training data and evaluates on the data the model hasn't seen before: the testing data.
|
||
|
|
||
|
This video gives a basic and nice explanation: https://www.youtube.com/watch?v=_vdMKioCXqQ
|
||
|
|
||
|
This article explains the conditions to split the data and how to split it: https://machinelearningmastery.com/train-test-split-for-evaluating-machine-learning-algorithms/
|
||
|
|
||
|
```python
|
||
|
X = np.arange(1,21).reshape(10,-1)
|
||
|
y = np.arange(1,11)
|
||
|
```
|
||
|
|
||
|
1. Split the data using `train_test_split` with `shuffle=False`. The test set represents 20% of the total size of the data set. Print X_train, y_train, X_test, y_test.
|
||
|
|
||
|
https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html
|