Zekun Wu commited on
Commit
ce5d5ba
1 Parent(s): 9602d77
Files changed (1) hide show
  1. pages/2_Evaluation.py +6 -15
pages/2_Evaluation.py CHANGED
@@ -55,11 +55,7 @@ def app():
55
  fig_construction = create_sector_plot(df, df['Occupation'][0])
56
  st.plotly_chart(fig_construction)
57
 
58
- # Additional plots
59
- st.subheader("Additional Plots")
60
 
61
- # Histogram of Scores
62
- st.write("Histogram of Scores")
63
  hist_fig = px.histogram(df.melt(id_vars=['Role'],
64
  value_vars=['Privilege_Avg_Score', 'Protect_Avg_Score',
65
  'Neutral_Avg_Score']),
@@ -67,36 +63,31 @@ def app():
67
  title='Distribution of Scores')
68
  st.plotly_chart(hist_fig)
69
 
70
- # Box Plot of Scores
71
- st.write("Box Plot of Scores")
72
  box_fig = px.box(df.melt(id_vars=['Role'], value_vars=['Privilege_Avg_Score', 'Protect_Avg_Score',
73
  'Neutral_Avg_Score']),
74
  x='variable', y='value', color='variable', title='Spread of Scores')
75
  st.plotly_chart(box_fig)
76
 
77
- # Scatter Plot with Trend Line
78
- st.write("Scatter Plot with Trend Line")
79
  scatter_fig = px.scatter_matrix(df, dimensions=['Privilege_Avg_Score', 'Protect_Avg_Score',
80
  'Neutral_Avg_Score'],
81
  title='Scatter Plot with Trend Line')
82
  st.plotly_chart(scatter_fig)
83
 
84
- # Heatmap of Correlations
85
- st.write("Heatmap of Correlations")
86
  corr_fig = px.imshow(df[['Privilege_Avg_Score', 'Protect_Avg_Score', 'Neutral_Avg_Score']].corr(),
87
  title='Correlation Heatmap')
88
  st.plotly_chart(corr_fig)
89
 
90
- # Additional rank plots
91
- st.write("Histogram of Ranks")
92
  hist_rank_fig = px.histogram(
93
- df.melt(id_vars=['Role'], value_vars=['Rank_Privilege', 'Rank_Protection', 'Rank_Neutral']),
94
  x='value', color='variable', facet_col='variable', title='Distribution of Ranks')
95
  st.plotly_chart(hist_rank_fig)
96
 
97
- st.write("Box Plot of Ranks")
98
  box_rank_fig = px.box(
99
- df.melt(id_vars=['Role'], value_vars=['Rank_Privilege', 'Rank_Protection', 'Rank_Neutral']),
100
  x='variable', y='value', color='variable', title='Spread of Ranks')
101
  st.plotly_chart(box_rank_fig)
102
 
 
55
  fig_construction = create_sector_plot(df, df['Occupation'][0])
56
  st.plotly_chart(fig_construction)
57
 
 
 
58
 
 
 
59
  hist_fig = px.histogram(df.melt(id_vars=['Role'],
60
  value_vars=['Privilege_Avg_Score', 'Protect_Avg_Score',
61
  'Neutral_Avg_Score']),
 
63
  title='Distribution of Scores')
64
  st.plotly_chart(hist_fig)
65
 
 
 
66
  box_fig = px.box(df.melt(id_vars=['Role'], value_vars=['Privilege_Avg_Score', 'Protect_Avg_Score',
67
  'Neutral_Avg_Score']),
68
  x='variable', y='value', color='variable', title='Spread of Scores')
69
  st.plotly_chart(box_fig)
70
 
71
+
 
72
  scatter_fig = px.scatter_matrix(df, dimensions=['Privilege_Avg_Score', 'Protect_Avg_Score',
73
  'Neutral_Avg_Score'],
74
  title='Scatter Plot with Trend Line')
75
  st.plotly_chart(scatter_fig)
76
 
77
+
 
78
  corr_fig = px.imshow(df[['Privilege_Avg_Score', 'Protect_Avg_Score', 'Neutral_Avg_Score']].corr(),
79
  title='Correlation Heatmap')
80
  st.plotly_chart(corr_fig)
81
 
82
+
 
83
  hist_rank_fig = px.histogram(
84
+ df.melt(id_vars=['Role'], value_vars=['Privilege_Rank', 'Protection_Rank', 'Neutral_Rank']),
85
  x='value', color='variable', facet_col='variable', title='Distribution of Ranks')
86
  st.plotly_chart(hist_rank_fig)
87
 
88
+
89
  box_rank_fig = px.box(
90
+ df.melt(id_vars=['Role'], value_vars=['Privilege_Rank', 'Protection_Rank', 'Neutral_Rank']),
91
  x='variable', y='value', color='variable', title='Spread of Ranks')
92
  st.plotly_chart(box_rank_fig)
93