Spaces:
Sleeping
Sleeping
import streamlit as st | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import sklearn | |
import streamlit as st | |
import pandas as pd | |
import numpy as np | |
# Load the dataset | |
df = pd.read_csv(r"C:\Users\91879\Downloads\data.csv") | |
st.title("π Exploratory Data Analysis") | |
# Fill missing values | |
df.fillna(df.mean(), inplace=True) | |
st.subheader("π View Dataset Preview") | |
if st.button("π Show Dataset Head"): | |
st.dataframe(df.head()) | |
features = [ | |
'Brake_Pressure', 'Pad_Wear_Level', 'ABS_Status', | |
'Wheel_Speed_FL', 'Wheel_Speed_FR', | |
'Wheel_Speed_RL', 'Wheel_Speed_RR', | |
'Fluid_Temperature', 'Pedal_Position' | |
] | |
st.subheader("β οΈ Fault Distribution") | |
fault_counts = df['Fault'].value_counts() | |
st.bar_chart(fault_counts) | |
st.write(df['Fault'].value_counts(normalize=True) * 100) | |
st.subheader("π Correlation Heatmap") | |
corr = df.corr() | |
fig, ax = plt.subplots(figsize=(10, 8)) | |
sns.heatmap(corr, annot=True, fmt=".2f", cmap="coolwarm", ax=ax) | |
st.pyplot(fig) | |