1. Learn
  2. /
  3. Courses
  4. /
  5. Analyzing IoT Data in Python

Exercise

Train/Test split

To avoid overfitting, it's common practice in Machine Learning to split data into train and test datasets. This is done to ensure that the model is able to correctly predict new, unseen data.

Since we're working with time-series data, we cannot use random split methods, as that would allow the model to know the future.

A function to print the start and end of a DataFrame is available as show_start_end(), which takes a DataFrame as the only argument, and returns a string.

The data is available as environment.

Instructions 1/3

undefined XP
    1
    2
    3
  • Define the date to use as split-point as "2018-10-27".
  • Split the data into train_env and test_env.