This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fig, axes = plt.subplots(nrows=5,ncols=1) | |
| fig.set_size_inches(10, 30) | |
| sb.boxplot(data=data,y="cnt",orient="v",ax=axes[0], palette="Greens") | |
| sb.boxplot(data=data,y="cnt",x="season",orient="v",ax=axes[1], palette="Greens") | |
| sb.boxplot(data=data,y="cnt",x="hr",orient="v",ax=axes[2], palette="Greens") | |
| sb.boxplot(data=data,y="cnt",x="yr",orient="v",ax=axes[3], palette="Greens") | |
| sb.boxplot(data=data,y="cnt",x="workingday",orient="v",ax=axes[4], palette="Greens") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plt.figure(figsize=(20, 8)) | |
| sb.distplot(data['cnt'], color='g', bins=30, hist_kws={'alpha': 0.4}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print(data.isnull().sum()) | |
| ms.matrix(data,figsize=(10,3), color = (0.1, 0.4, 0.1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| categorical_features = {"season", "yr", "mnth", "holiday", "hr", "workingday", "weekday", "weathersit"} | |
| for feature in categorical_features: | |
| data[feature] = data[feature].astype("category") | |
| data.dtypes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data.dtypes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| drop_features = {"instant", "dteday"} | |
| data = data.drop(columns=drop_features) | |
| data.head() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print(data.shape) | |
| data.head() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data = pd.read_csv('hour_train.csv') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import seaborn as sb | |
| import matplotlib.pyplot as plt | |
| import missingno as ms | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| prediction = model.predict(X_test) | |
| prediction1 = pd.DataFrame({'IRIS1':prediction[:,0],'IRIS2':prediction[:,1], 'IRIS3':prediction[:,2]}) | |
| prediction1.round(decimals=4).head() |