Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,19 +78,21 @@ st.title("🎗️ Cancer Prediction Using Machine Learning 🎗️")
|
|
| 78 |
st.markdown("""<style>.big-font {font-size:20px !important;}</style>
|
| 79 |
<p class="big-font">Provide patient details below to predict cancer presence:</p>""", unsafe_allow_html=True)
|
| 80 |
|
|
|
|
| 81 |
col1, col2 = st.columns(2)
|
|
|
|
| 82 |
with col1:
|
| 83 |
-
age = st.
|
| 84 |
-
tumor_size = st.
|
| 85 |
-
tumor_grade = st.
|
| 86 |
-
symptoms_severity = st.
|
| 87 |
|
| 88 |
with col2:
|
| 89 |
-
smoking_history = st.
|
| 90 |
-
alcohol_consumption = st.
|
| 91 |
-
exercise_frequency = st.
|
| 92 |
-
gender = st.
|
| 93 |
-
family_history = st.
|
| 94 |
|
| 95 |
input_data = [[age, tumor_size, tumor_grade, symptoms_severity, smoking_history,
|
| 96 |
alcohol_consumption, exercise_frequency, gender, family_history]]
|
|
@@ -104,4 +106,4 @@ if st.button("Predict Cancer Presence"):
|
|
| 104 |
prediction = model.named_steps['classifier'].predict(input_transformed)
|
| 105 |
st.markdown(f"**Prediction Result: {'🟥 Positive' if prediction[0] == 1 else '🟩 Negative'}**")
|
| 106 |
else:
|
| 107 |
-
st.error("Please train a model first!")
|
|
|
|
| 78 |
st.markdown("""<style>.big-font {font-size:20px !important;}</style>
|
| 79 |
<p class="big-font">Provide patient details below to predict cancer presence:</p>""", unsafe_allow_html=True)
|
| 80 |
|
| 81 |
+
# Updated controls with radio buttons or buttons
|
| 82 |
col1, col2 = st.columns(2)
|
| 83 |
+
|
| 84 |
with col1:
|
| 85 |
+
age = st.radio("Age", [18, 20, 30, 40, 50, 60, 70, 80, 90, 100])
|
| 86 |
+
tumor_size = st.radio("Tumor Size", [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
|
| 87 |
+
tumor_grade = st.radio("Tumor Grade", ['High', 'Low', 'Medium'])
|
| 88 |
+
symptoms_severity = st.radio("Symptoms Severity", ['Mild', 'Moderate', 'Severe'])
|
| 89 |
|
| 90 |
with col2:
|
| 91 |
+
smoking_history = st.radio("Smoking History", ['Never Smoker', 'Former Smoker', 'Current Smoker'])
|
| 92 |
+
alcohol_consumption = st.radio("Alcohol Consumption", ['Low', 'Moderate', 'High'])
|
| 93 |
+
exercise_frequency = st.radio("Exercise Frequency", ['Rarely', 'Occasionally', 'Regularly', 'Never'])
|
| 94 |
+
gender = st.radio("Gender", ['Male', 'Female'])
|
| 95 |
+
family_history = st.radio("Family History", ["No", "Yes"])
|
| 96 |
|
| 97 |
input_data = [[age, tumor_size, tumor_grade, symptoms_severity, smoking_history,
|
| 98 |
alcohol_consumption, exercise_frequency, gender, family_history]]
|
|
|
|
| 106 |
prediction = model.named_steps['classifier'].predict(input_transformed)
|
| 107 |
st.markdown(f"**Prediction Result: {'🟥 Positive' if prediction[0] == 1 else '🟩 Negative'}**")
|
| 108 |
else:
|
| 109 |
+
st.error("Please train a model first!")
|