Spaces:
Sleeping
Sleeping
Update EDA.py
Browse files
EDA.py
CHANGED
@@ -1,44 +1,45 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import pandas as pd
|
3 |
-
import seaborn as sns
|
4 |
-
import matplotlib.pyplot as plt
|
5 |
-
import
|
6 |
-
import
|
7 |
-
import
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
st.
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import seaborn as sns
|
4 |
+
import matplotlib.pyplot as plt
|
5 |
+
import sklearn
|
6 |
+
import streamlit as st
|
7 |
+
import pandas as pd
|
8 |
+
import numpy as np
|
9 |
+
|
10 |
+
# Load the dataset
|
11 |
+
df = pd.read_csv(r"C:\Users\91879\Downloads\data.csv")
|
12 |
+
|
13 |
+
st.title("π Exploratory Data Analysis")
|
14 |
+
|
15 |
+
|
16 |
+
# Fill missing values
|
17 |
+
df.fillna(df.mean(), inplace=True)
|
18 |
+
st.subheader("π View Dataset Preview")
|
19 |
+
|
20 |
+
if st.button("π Show Dataset Head"):
|
21 |
+
st.dataframe(df.head())
|
22 |
+
|
23 |
+
|
24 |
+
features = [
|
25 |
+
'Brake_Pressure', 'Pad_Wear_Level', 'ABS_Status',
|
26 |
+
'Wheel_Speed_FL', 'Wheel_Speed_FR',
|
27 |
+
'Wheel_Speed_RL', 'Wheel_Speed_RR',
|
28 |
+
'Fluid_Temperature', 'Pedal_Position'
|
29 |
+
]
|
30 |
+
|
31 |
+
st.subheader("β οΈ Fault Distribution")
|
32 |
+
fault_counts = df['Fault'].value_counts()
|
33 |
+
st.bar_chart(fault_counts)
|
34 |
+
st.write(df['Fault'].value_counts(normalize=True) * 100)
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
st.subheader("π Correlation Heatmap")
|
39 |
+
corr = df.corr()
|
40 |
+
fig, ax = plt.subplots(figsize=(10, 8))
|
41 |
+
sns.heatmap(corr, annot=True, fmt=".2f", cmap="coolwarm", ax=ax)
|
42 |
+
st.pyplot(fig)
|
43 |
+
|
44 |
+
|
45 |
+
|