Sowmith22 commited on
Commit
85acae2
Β·
verified Β·
1 Parent(s): 12de5fa

Update EDA.py

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