Activity 13.01 – Creating a time series model
In this activity, as a data analyst for a bike-share startup, you are provided with a dataset that has hourly unit rentals for a bike-share business. You are tasked to create a very simple model to predict the rentals one week in advance. Here, you will use linear regression from scikit-learn, which you saw in Chapter 11, Data Modeling –Regression:
- For this activity, you will need the
pandas
library, thematplotlib.pyplot
library, and thesklearn.linear_model.LinearRegression
module. Load them in the first cell of the notebook:import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression
- Read in the
bike_share.csv
data from theDatasets
directory, and list the first few rows:
- You need to create a
datetime
index. Construct a new datetime-valued column as a combination of the date and the hour and...