|
11 | 11 | from sklearn.tree import DecisionTreeRegressor
|
12 | 12 | from sklearn.ensemble import RandomForestRegressor
|
13 | 13 | from sklearn.metrics import mean_squared_error, r2_score
|
14 |
| -import plotly.graph_objs as go |
15 | 14 |
|
16 | 15 |
|
17 | 16 | # Define the tasks for each level
|
|
23 | 22 |
|
24 | 23 | # Create the Streamlit web app
|
25 | 24 | def main():
|
| 25 | + st.set_page_config(page_title="Zomato Data Analysis", page_icon="🥘", layout="wide") |
26 | 26 | st.title('Zomato Data Analysis')
|
27 | 27 |
|
28 | 28 | st.sidebar.title('Navigation')
|
@@ -399,8 +399,26 @@ def main():
|
399 | 399 | st.markdown("- Determine if there are any specific cuisines that tend to receive higher ratings")
|
400 | 400 | top_cuisines = cuisine_ratings.head(10)
|
401 | 401 | st.write('Top 10 cuisines with highest ratings:\n', top_cuisines)
|
| 402 | + |
| 403 | + |
| 404 | + if selected_task == 'Task 3' and selected_level == 'Level 3': |
| 405 | + st.write("Restaurant Ratings Analysis") |
| 406 | + df = pd.read_csv("./data/data.csv") |
| 407 | + |
| 408 | + st.write("### Distribution of Aggregate Rating") |
| 409 | + st.plotly_chart(px.histogram(df, x='Aggregate rating', nbins=20, title='Distribution of Aggregate Rating')) |
| 410 | + |
| 411 | + st.write("### Average Rating by Cuisine") |
| 412 | + st.plotly_chart(px.bar(df, x='Cuisines', y='Aggregate rating', title='Average Rating by Cuisine')) |
| 413 | + |
| 414 | + st.write("### Aggregate Rating by City") |
| 415 | + st.plotly_chart(px.violin(df, y='Aggregate rating', x='City', box=True, points='all', title='Aggregate Rating by City')) |
402 | 416 |
|
| 417 | + st.write("### Hexbin Plot of Ratings by Location") |
| 418 | + st.plotly_chart(px.density_heatmap(df, x='Longitude', y='Latitude', z='Aggregate rating', nbinsx=30, nbinsy=30, title='Hexbin Plot of Ratings by Location')) |
403 | 419 |
|
| 420 | + st.write("### Bubble Plot of Ratings vs Votes") |
| 421 | + st.plotly_chart(px.scatter(df, x='Votes', y='Aggregate rating', size='Price range', color='City', hover_name='Restaurant Name', title='Bubble Plot of Ratings vs Votes')) |
404 | 422 |
|
405 | 423 |
|
406 | 424 | if __name__ == '__main__':
|
|
0 commit comments