Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,20 +59,6 @@ def display_prediction(prediction, prediction_probabilities):
|
|
| 59 |
prob_df = pd.DataFrame(prediction_probabilities, index=class_labels, columns=["Probability"])
|
| 60 |
st.bar_chart(prob_df)
|
| 61 |
|
| 62 |
-
# Example chart: Feature Importance
|
| 63 |
-
st.subheader("Feature Importance:")
|
| 64 |
-
feature_importance = np.random.rand(len(class_labels)) # Random feature importance values for demonstration
|
| 65 |
-
features_names = ['use_of_ip_address', 'abnormal_url', 'google_index', 'count_www', 'count@',
|
| 66 |
-
'count_dir', 'count_embed_domian', 'short_url', 'count_https',
|
| 67 |
-
'count_http', 'count%', 'count?', 'count-', 'count=', 'url_length',
|
| 68 |
-
'hostname_length', 'sus_url', 'fd_length', 'tld_length', 'count-digits',
|
| 69 |
-
'count-letters']
|
| 70 |
-
|
| 71 |
-
fig, ax = plt.subplots()
|
| 72 |
-
ax.barh(features_names, feature_importance, color='skyblue')
|
| 73 |
-
ax.set_xlabel('Importance')
|
| 74 |
-
ax.set_title('Feature Importance')
|
| 75 |
-
st.pyplot(fig)
|
| 76 |
|
| 77 |
# Another example chart: Prediction distribution (simulated)
|
| 78 |
st.subheader("Prediction Distribution (Simulated):")
|
|
|
|
| 59 |
prob_df = pd.DataFrame(prediction_probabilities, index=class_labels, columns=["Probability"])
|
| 60 |
st.bar_chart(prob_df)
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
# Another example chart: Prediction distribution (simulated)
|
| 64 |
st.subheader("Prediction Distribution (Simulated):")
|