October 2017
Intermediate to advanced
330 pages
7h 7m
English
import numpy as np import pandas as pdfrom sklearn.model_selection import train_test_splitfrom keras.models import Sequentialfrom keras.layers import Dense, Dropoutfrom keras.wrappers.scikit_learn import KerasRegressorfrom sklearn.model_selection import cross_val_scorefrom sklearn.model_selection import KFoldfrom sklearn.preprocessing import StandardScalerfrom sklearn.pipeline import Pipelineimport numpy as npfrom matplotlib import pyplot as plt
data = pd.read_csv('../Data/Bike-Sharing-Dataset/hour.csv')# Feature engineeringohe_features = ['season', 'weathersit', 'mnth', 'hr', 'weekday']for feature in ohe_features: dummies = pd.get_dummies(data[feature], ...Read now
Unlock full access