Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,7 +71,7 @@ st.markdown("<h1 style='text-align: center; color: #1976D2;'>🎗️ Cancer Pred
|
|
| 71 |
df = load_data()
|
| 72 |
X_train, X_test, y_train, y_test, preprocess = preprocess_data(df)
|
| 73 |
|
| 74 |
-
model_name = st.
|
| 75 |
|
| 76 |
if st.button("Train Model"):
|
| 77 |
model = train_model(X_train, y_train, preprocess, model_name)
|
|
@@ -85,13 +85,13 @@ st.markdown("<h2 style='color: #D32F2F;'>🔍 Make a Prediction</h2>", unsafe_al
|
|
| 85 |
|
| 86 |
age = st.number_input("Age", min_value=18, max_value=100, value=30)
|
| 87 |
tumor_size = st.number_input("Tumor Size", min_value=1.0, max_value=10.0, value=5.0)
|
| 88 |
-
tumor_grade = st.
|
| 89 |
-
symptoms_severity = st.
|
| 90 |
-
smoking_history = st.
|
| 91 |
-
alcohol_consumption = st.
|
| 92 |
-
exercise_frequency = st.
|
| 93 |
-
gender = st.
|
| 94 |
-
family_history = st.
|
| 95 |
|
| 96 |
input_data = [[age, tumor_size, tumor_grade, symptoms_severity, smoking_history,
|
| 97 |
alcohol_consumption, exercise_frequency, gender, family_history]]
|
|
|
|
| 71 |
df = load_data()
|
| 72 |
X_train, X_test, y_train, y_test, preprocess = preprocess_data(df)
|
| 73 |
|
| 74 |
+
model_name = st.radio("Select Model", ['Decision Tree', 'SVM', 'Logistic Regression', 'KNN'])
|
| 75 |
|
| 76 |
if st.button("Train Model"):
|
| 77 |
model = train_model(X_train, y_train, preprocess, model_name)
|
|
|
|
| 85 |
|
| 86 |
age = st.number_input("Age", min_value=18, max_value=100, value=30)
|
| 87 |
tumor_size = st.number_input("Tumor Size", min_value=1.0, max_value=10.0, value=5.0)
|
| 88 |
+
tumor_grade = st.radio("Tumor Grade", [1, 2, 3])
|
| 89 |
+
symptoms_severity = st.radio("Symptoms Severity", [1, 2, 3])
|
| 90 |
+
smoking_history = st.radio("Smoking History", [0, 1, 2])
|
| 91 |
+
alcohol_consumption = st.radio("Alcohol Consumption", [0, 1, 2, 3])
|
| 92 |
+
exercise_frequency = st.radio("Exercise Frequency", [0, 1, 2, 3])
|
| 93 |
+
gender = st.radio("Gender", [0, 1])
|
| 94 |
+
family_history = st.radio("Family History", [0, 1])
|
| 95 |
|
| 96 |
input_data = [[age, tumor_size, tumor_grade, symptoms_severity, smoking_history,
|
| 97 |
alcohol_consumption, exercise_frequency, gender, family_history]]
|