Spaces:
Runtime error
Runtime error
Commit
•
c378d97
1
Parent(s):
1454e13
Update eda.py
Browse files
eda.py
CHANGED
@@ -27,20 +27,19 @@ def run():
|
|
27 |
st.title('Heart Failure Prediction')
|
28 |
# st.subheader('Heart Failure Prediction Exploratory Data Analysis')
|
29 |
# #Show Dataframe
|
30 |
-
|
31 |
-
# st.dataframe(d)
|
32 |
fig, ax = plt.subplots(nrows=2, ncols=2, figsize=(12, 10))
|
33 |
|
34 |
-
sns.histplot(data=
|
35 |
axes[0, 0].set_title("Booking Behavior by Hotel Type (Lead Time)")
|
36 |
|
37 |
-
sns.barplot(data=
|
38 |
axes[0, 1].set_title("Cancellation Rate by Hotel Type")
|
39 |
|
40 |
-
sns.countplot(data=
|
41 |
axes[1, 0].set_title("Booking Changes by Hotel Type")
|
42 |
|
43 |
-
sns.countplot(data=
|
44 |
axes[1, 1].set_title("Total Bookings by Hotel Type")
|
45 |
|
46 |
|
|
|
27 |
st.title('Heart Failure Prediction')
|
28 |
# st.subheader('Heart Failure Prediction Exploratory Data Analysis')
|
29 |
# #Show Dataframe
|
30 |
+
d = pd.read_csv('hotel_bookings.csv')
|
|
|
31 |
fig, ax = plt.subplots(nrows=2, ncols=2, figsize=(12, 10))
|
32 |
|
33 |
+
sns.histplot(data=d, x='lead_time', hue='hotel', multiple='stack', bins=20, ax=ax[0, 0], palette='Set1')
|
34 |
axes[0, 0].set_title("Booking Behavior by Hotel Type (Lead Time)")
|
35 |
|
36 |
+
sns.barplot(data=d, x='hotel', y='is_canceled', ax=ax[0, 1], palette='Set1')
|
37 |
axes[0, 1].set_title("Cancellation Rate by Hotel Type")
|
38 |
|
39 |
+
sns.countplot(data=d, x='booking_changes', hue='hotel', ax=ax[1, 0], palette='Set1')
|
40 |
axes[1, 0].set_title("Booking Changes by Hotel Type")
|
41 |
|
42 |
+
sns.countplot(data=d, x='hotel', ax=ax[1, 1], palette='Set1')
|
43 |
axes[1, 1].set_title("Total Bookings by Hotel Type")
|
44 |
|
45 |
|