3. Preparing Data for Predictive Modeling
Activity 3.01: Preparing to Train a Predictive Model for Employee Retention
Solution:
- Check the head of the table by running the following command:
%%bash head ../data/hr-analytics/hr_data.csv
Note how we specify paths relative to the notebook's location. In this case, we need to step back one directory (by using "
..
" in the file path), which brings us to the root folder for the project. Then, we look indata/hr-analytics
forhr_data.csv
.This will generate the following output:
- If you cannot run bash in your notebook, run the following command:
with open('../data/hr-analytics/hr_data.csv', 'r') as f: Â Â Â Â for _ in range(10): Â Â Â Â Â Â Â Â print(next(f).strip())
The output is as follows:
Judging by the output, convince yourself that it...