ZainKhan007 commited on
Commit
da287b1
·
verified ·
1 Parent(s): ad87901

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -78,11 +78,12 @@ if st.button("Predict Fault Type"):
78
  predicted_class = np.argmax(prediction, axis=1)[0]
79
  st.success(f"The predicted fault class is: {predicted_class}")
80
 
81
- # Plot the entered values as a line chart
82
- if len(input_data) > 0:
83
- st.write("### Entered Feature Values")
84
- # Use Streamlit's built-in line chart
85
- input_df = pd.DataFrame({"Feature": feature_names, "Value": input_data})
86
- st.line_chart(input_df.set_index("Feature"))
87
-
88
- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/677c16fcbf7436d87e4d9a53/rBvB305BiwWLdwAOPYl55.png)
 
 
78
  predicted_class = np.argmax(prediction, axis=1)[0]
79
  st.success(f"The predicted fault class is: {predicted_class}")
80
 
81
+ # Plot the entered values as a line chart
82
+ plt.figure(figsize=(10, 4))
83
+ plt.plot(feature_names, input_data, marker='o')
84
+ plt.title("Visualization of Input Features")
85
+ plt.xlabel("Features")
86
+ plt.ylabel("Values")
87
+ plt.xticks(rotation=45)
88
+ plt.grid(True)
89
+ st.pyplot(plt)