|
|
import streamlit as st |
|
|
import pandas as pd |
|
|
import os |
|
|
|
|
|
|
|
|
st.title("Hotel Data Analysis App") |
|
|
st.markdown(""" |
|
|
Welcome to the **Hotel Data Analysis App**. This app is designed to help you analyze hotel datasets, perform feature engineering, and create predictive models. Use the sidebar to navigate through the pages. |
|
|
|
|
|
### Features: |
|
|
- Download the dataset for exploration. |
|
|
- Perform exploratory data analysis (EDA) and feature engineering. |
|
|
- Create and evaluate machine learning models. |
|
|
- Conclude insights from the analysis. |
|
|
|
|
|
### About the Data: |
|
|
The dataset includes hotel-related information such as price, ratings, discounts, cashback, and categories. It is designed for understanding relationships between features and building predictive models. |
|
|
""") |
|
|
|
|
|
|
|
|
st.markdown("## Upload Your Dataset") |
|
|
uploaded_file = st.file_uploader("Choose a CSV file", type="csv") |
|
|
|
|
|
|
|
|
if uploaded_file is not None: |
|
|
try: |
|
|
|
|
|
sample_data = pd.read_csv(uploaded_file) |
|
|
df = pd.DataFrame(sample_data) |
|
|
|
|
|
|
|
|
st.markdown("### Dataset Preview") |
|
|
st.dataframe(df.head()) |
|
|
|
|
|
|
|
|
csv = df.to_csv(index=False).encode('utf-8') |
|
|
|
|
|
|
|
|
st.markdown("### Download Processed Dataset") |
|
|
st.download_button( |
|
|
label="Download Sample Dataset", |
|
|
data=csv, |
|
|
file_name="hotel_data.csv", |
|
|
mime="text/csv" |
|
|
) |
|
|
except Exception as e: |
|
|
st.error(f"An error occurred while processing the file: {e}") |
|
|
else: |
|
|
st.warning("Please upload a dataset to proceed.") |
|
|
|
|
|
|