Harika22 commited on
Commit
a58a69d
·
verified ·
1 Parent(s): c4b254f

Update pages/Life cycle of ML.py

Browse files
Files changed (1) hide show
  1. pages/Life cycle of ML.py +140 -0
pages/Life cycle of ML.py CHANGED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ if "current_page" not in st.session_state:
4
+ st.session_state.current_page = "home"
5
+
6
+ def navigate_to(page):
7
+ st.session_state.current_page = page
8
+
9
+ # Custom CSS for styling
10
+ def add_custom_css():
11
+ st.markdown("""
12
+ <style>
13
+ .arrow-container {
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ gap: 20px;
18
+ margin-top: 50px;
19
+ flex-wrap: wrap;
20
+ }
21
+ .arrow {
22
+ background-color: #4CAF50;
23
+ color: white;
24
+ padding: 10px 20px;
25
+ text-align: center;
26
+ border-radius: 5px;
27
+ font-size: 16px;
28
+ font-weight: bold;
29
+ cursor: pointer;
30
+ box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
31
+ transition: all 0.2s ease;
32
+ }
33
+ .arrow:hover {
34
+ background-color: #45a049;
35
+ transform: scale(1.1);
36
+ }
37
+ .arrow:after {
38
+ content: "→";
39
+ margin-left: 10px;
40
+ }
41
+ .arrow:last-child:after {
42
+ content: "";
43
+ }
44
+ .back-btn {
45
+ margin-top: 20px;
46
+ background-color: #007BFF;
47
+ color: white;
48
+ padding: 10px 20px;
49
+ text-align: center;
50
+ border-radius: 5px;
51
+ font-size: 16px;
52
+ cursor: pointer;
53
+ box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
54
+ transition: all 0.2s ease;
55
+ }
56
+ .back-btn:hover {
57
+ background-color: #0056b3;
58
+ transform: scale(1.1);
59
+ }
60
+ </style>
61
+ """, unsafe_allow_html=True)
62
+
63
+ # Lifecycle Pages
64
+ def home_page():
65
+ st.title("🚀 Machine Learning Lifecycle")
66
+ st.write("Explore the stages of the ML lifecycle by clicking on the arrows below.")
67
+
68
+ # Arrow buttons container
69
+ st.markdown('<div class="arrow-container">', unsafe_allow_html=True)
70
+ if st.button("1. Problem Definition", key="problem_definition"):
71
+ navigate_to("problem_definition")
72
+ if st.button("2. Data Collection", key="data_collection"):
73
+ navigate_to("data_collection")
74
+ if st.button("3. Data Preparation", key="data_preparation"):
75
+ navigate_to("data_preparation")
76
+ if st.button("4. Modeling", key="modeling"):
77
+ navigate_to("modeling")
78
+ if st.button("5. Evaluation", key="evaluation"):
79
+ navigate_to("evaluation")
80
+ if st.button("6. Deployment", key="deployment"):
81
+ navigate_to("deployment")
82
+ st.markdown('</div>', unsafe_allow_html=True)
83
+
84
+ def problem_definition_page():
85
+ st.title("📌 Problem Definition")
86
+ st.write("Define the problem you are solving with your machine learning model.")
87
+ st.markdown('<div class="back-btn" onclick="location.href=\'#\'">⬅️ Back to Home</div>', unsafe_allow_html=True)
88
+ if st.button("⬅️ Back to Home"):
89
+ navigate_to("home")
90
+
91
+ def data_collection_page():
92
+ st.title("📊 Data Collection")
93
+ st.write("Gather data relevant to the problem.")
94
+ if st.button("⬅️ Back to Home"):
95
+ navigate_to("home")
96
+
97
+ def data_preparation_page():
98
+ st.title("🔧 Data Preparation")
99
+ st.write("Clean and preprocess the data for analysis.")
100
+ if st.button("⬅️ Back to Home"):
101
+ navigate_to("home")
102
+
103
+ def modeling_page():
104
+ st.title("🤖 Modeling")
105
+ st.write("Train and tune machine learning models.")
106
+ if st.button("⬅️ Back to Home"):
107
+ navigate_to("home")
108
+
109
+ def evaluation_page():
110
+ st.title("📈 Evaluation")
111
+ st.write("Evaluate model performance using metrics.")
112
+ if st.button("⬅️ Back to Home"):
113
+ navigate_to("home")
114
+
115
+ def deployment_page():
116
+ st.title("🌐 Deployment")
117
+ st.write("Deploy the model to production for real-world use.")
118
+ if st.button("⬅️ Back to Home"):
119
+ navigate_to("home")
120
+
121
+ def main():
122
+ add_custom_css()
123
+
124
+ if st.session_state.current_page == "home":
125
+ home_page()
126
+ elif st.session_state.current_page == "problem_definition":
127
+ problem_definition_page()
128
+ elif st.session_state.current_page == "data_collection":
129
+ data_collection_page()
130
+ elif st.session_state.current_page == "data_preparation":
131
+ data_preparation_page()
132
+ elif st.session_state.current_page == "modeling":
133
+ modeling_page()
134
+ elif st.session_state.current_page == "evaluation":
135
+ evaluation_page()
136
+ elif st.session_state.current_page == "deployment":
137
+ deployment_page()
138
+
139
+ if __name__ == "__main__":
140
+ main()