Spaces:
Sleeping
Sleeping
add the about app msection
Browse files
app.py
CHANGED
@@ -50,40 +50,53 @@ def perform_svm_regression(df, problem_description, interpretation_text):
|
|
50 |
st.write(interpretation_text)
|
51 |
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
df,
|
66 |
-
"**Business Problem:** Predicting customer churn based on usage patterns and demographics.",
|
67 |
-
"The model predicts customer churn rate based on usage patterns and demographics. "
|
68 |
-
"This information can be used to identify customers at risk of churning and take proactive steps to retain them.",
|
69 |
-
)
|
70 |
|
71 |
-
#
|
72 |
-
|
73 |
-
|
74 |
-
perform_svm_regression(
|
75 |
-
df,
|
76 |
-
"**Engineering Problem:** Predicting the remaining useful life of an industrial machine based on sensor data.",
|
77 |
-
"The model predicts the remaining useful life of an industrial machine based on sensor data. "
|
78 |
-
"This information can be used to schedule maintenance and prevent costly downtime.",
|
79 |
)
|
80 |
|
81 |
-
# ---
|
82 |
-
with
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
st.write(interpretation_text)
|
51 |
|
52 |
|
53 |
+
def main():
|
54 |
+
# --- App ---
|
55 |
+
st.title("SVM Regressor Demo")
|
56 |
+
|
57 |
+
about = """This app demonstrates the use of Support Vector Machine (SVM) regression
|
58 |
+
for different problems: Business, Engineering, and Education. Select a problem to
|
59 |
+
view the dataset, train an SVM model, and interpret the results. Explore the
|
60 |
+
impact of hyperparameter tuning and visualize the predictions.
|
61 |
+
|
62 |
+
Created by Louie F. Cervantes, M.Eng. (Information Engineering)"""
|
63 |
+
with st.expander("About"):
|
64 |
+
st.markdown(about)
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
+
# Tabs for each problem
|
67 |
+
tab1, tab2, tab3 = st.tabs(
|
68 |
+
["Business Problem", "Engineering Problem", "Education Problem"]
|
|
|
|
|
|
|
|
|
|
|
69 |
)
|
70 |
|
71 |
+
# --- Business Problem ---
|
72 |
+
with tab1:
|
73 |
+
df = pd.read_csv("business_data.csv")
|
74 |
+
perform_svm_regression(
|
75 |
+
df,
|
76 |
+
"**Business Problem:** Predicting customer churn based on usage patterns and demographics.",
|
77 |
+
"The model predicts customer churn rate based on usage patterns and demographics. "
|
78 |
+
"This information can be used to identify customers at risk of churning and take proactive steps to retain them.",
|
79 |
+
)
|
80 |
+
|
81 |
+
# --- Engineering Problem ---
|
82 |
+
with tab2:
|
83 |
+
df = pd.read_csv("engineering_data.csv")
|
84 |
+
perform_svm_regression(
|
85 |
+
df,
|
86 |
+
"**Engineering Problem:** Predicting the remaining useful life of an industrial machine based on sensor data.",
|
87 |
+
"The model predicts the remaining useful life of an industrial machine based on sensor data. "
|
88 |
+
"This information can be used to schedule maintenance and prevent costly downtime.",
|
89 |
+
)
|
90 |
+
|
91 |
+
# --- Education Problem ---
|
92 |
+
with tab3:
|
93 |
+
df = pd.read_csv("education_data.csv")
|
94 |
+
perform_svm_regression(
|
95 |
+
df,
|
96 |
+
"**Education Problem:** Predicting student performance on a standardized test based on study habits and previous grades.",
|
97 |
+
"The model predicts student performance on a standardized test based on study habits and previous grades. "
|
98 |
+
"This information can be used to identify students who may need extra help and provide them with appropriate support.",
|
99 |
+
)
|
100 |
+
|
101 |
+
if __name__ == "__main__":
|
102 |
+
main()
|