Man0707 commited on
Commit
2c170d3
·
verified ·
1 Parent(s): 4ad2739

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +3 -4
src/streamlit_app.py CHANGED
@@ -25,15 +25,14 @@ def get_data():
25
  df = get_data()
26
  st.write("Dataset loaded! Here's a preview:")
27
  st.dataframe(df.head())
28
-
29
  # -------------------------- Preprocessing --------------------------
30
- # Drop ID (not useful) and separate features/target
31
- X = df.drop(["quality", "Id"], axis=1)
32
  y = df["quality"]
33
 
34
- # Make it a binary classification (good ≥ 6, bad < 6) - common practice
35
  y = (y >= 6).astype(int)
36
 
 
37
  # Train-test split
38
  X_train, X_test, y_train, y_test = train_test_split(
39
  X, y, test_size=0.2, random_state=42, stratify=y
 
25
  df = get_data()
26
  st.write("Dataset loaded! Here's a preview:")
27
  st.dataframe(df.head())
 
28
  # -------------------------- Preprocessing --------------------------
29
+ X = df.drop("quality", axis=1) # fixed: no "Id" column exists
 
30
  y = df["quality"]
31
 
32
+ # Make it binary classification: good (≥6) vs bad (<6)
33
  y = (y >= 6).astype(int)
34
 
35
+
36
  # Train-test split
37
  X_train, X_test, y_train, y_test = train_test_split(
38
  X, y, test_size=0.2, random_state=42, stratify=y