How to do it...

  1. First, load all libraries:
import numpy as npimport pandas as pdfrom matplotlib import pyplot as pltfrom keras.models import Sequentialfrom keras.layers import Dense, Dropoutfrom keras import regularizers
  1. Import the data and extract the features:
data = pd.read_csv('Data/bike-sharing/hour.csv')# Feature engineeringohe_features = ['season', 'weathersit', 'mnth', 'hr', 'weekday']for feature in ohe_features:    dummies = pd.get_dummies(data[feature], prefix=feature, drop_first=False)    data = pd.concat([data, dummies], axis=1)drop_features = ['instant', 'dteday', 'season', 'weathersit',                   'weekday', 'atemp', 'mnth', 'workingday', 'hr', 'casual', 'registered']data = data.drop(drop_features, axis=1)
  1. Normalize numerical data:

Get Python Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.