Skip to content

Instantly share code, notes, and snippets.

View NMZivkovic's full-sized avatar

Nikola Živković NMZivkovic

View GitHub Profile
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")
plt.figure(figsize=(20, 8))
sb.distplot(data['cnt'], color='g', bins=30, hist_kws={'alpha': 0.4});
print(data.isnull().sum())
ms.matrix(data,figsize=(10,3), color = (0.1, 0.4, 0.1))
categorical_features = {"season", "yr", "mnth", "holiday", "hr", "workingday", "weekday", "weathersit"}
for feature in categorical_features:
data[feature] = data[feature].astype("category")
data.dtypes
drop_features = {"instant", "dteday"}
data = data.drop(columns=drop_features)
data.head()
print(data.shape)
data.head()
data = pd.read_csv('hour_train.csv')
import pandas as pd
import seaborn as sb
import matplotlib.pyplot as plt
import missingno as ms
import numpy as np
prediction = model.predict(X_test)
prediction1 = pd.DataFrame({'IRIS1':prediction[:,0],'IRIS2':prediction[:,1], 'IRIS3':prediction[:,2]})
prediction1.round(decimals=4).head()