Sathwikchowdary commited on
Commit
f107edf
·
verified ·
1 Parent(s): 5f5a6f9

Update pages/Life_cycle_of_ML.py

Browse files
Files changed (1) hide show
  1. pages/Life_cycle_of_ML.py +107 -32
pages/Life_cycle_of_ML.py CHANGED
@@ -84,38 +84,113 @@ The life cycle of Machine Learning (ML) involves several stages, from defining t
84
  </marker>
85
  </defs>
86
  </svg>
87
-
88
- <!-- Buttons below shapes -->
89
-
90
- <!-- Problem Statement Button (Rectangle) -->
91
- <button style="width: 150px; height: 50px; background-color: #FFB6C1; border: 1px solid #000; text-align: center;">Problem Statement</button>
92
-
93
- <!-- Data Collection Button (Ellipse) -->
94
- <button style="width: 160px; height: 80px; background-color: #ADD8E6; border-radius: 40px; border: 1px solid #000; text-align: center;">Data Collection</button>
95
-
96
- <!-- Simple EDA Button (Ellipse) -->
97
- <button style="width: 160px; height: 80px; background-color: #90EE90; border-radius: 40px; border: 1px solid #000; text-align: center;">Simple EDA</button>
98
-
99
- <!-- Data Preprocessing Button (Rectangle) -->
100
- <button style="width: 150px; height: 50px; background-color: #FFD700; border: 1px solid #000; text-align: center;">Data Preprocessing</button>
101
-
102
- <!-- EDA Button (Circle) -->
103
- <button style="width: 80px; height: 80px; background-color: #FF7F50; border-radius: 50%; border: 1px solid #000; text-align: center;">EDA</button>
104
-
105
- <!-- Feature Engineering Button (Ellipse) -->
106
- <button style="width: 160px; height: 80px; background-color: #9370DB; border-radius: 40px; border: 1px solid #000; text-align: center;">Feature Engineering</button>
107
-
108
- <!-- Training Button (Rectangle) -->
109
- <button style="width: 150px; height: 50px; background-color: #FF6347; border: 1px solid #000; text-align: center;">Training</button>
110
-
111
- <!-- Testing Button (Circle) -->
112
- <button style="width: 80px; height: 80px; background-color: #98FB98; border-radius: 50%; border: 1px solid #000; text-align: center;">Testing</button>
113
-
114
- <!-- Deploying Button (Ellipse) -->
115
- <button style="width: 160px; height: 80px; background-color: #F0E68C; border-radius: 40px; border: 1px solid #000; text-align: center;">Deploying</button>
116
-
117
- <!-- Monitoring Button (Rectangle) -->
118
- <button style="width: 150px; height: 50px; background-color: #B0E0E6; border: 1px solid #000; text-align: center;">Monitoring</button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  """
120
 
121
  # Render HTML content in Streamlit
 
84
  </marker>
85
  </defs>
86
  </svg>
87
+ # Initialize session state for tracking the current lifecycle step
88
+ if "step" not in st.session_state:
89
+ st.session_state.step = 0
90
+
91
+ # Define ML lifecycle steps with detailed descriptions
92
+ ml_lifecycle = [
93
+ {
94
+ "title": "1️⃣ **Problem Statement**",
95
+ "description": """
96
+ **Understanding the problem and setting objectives for the ML model.
97
+ """
98
+ },
99
+ {
100
+ "title": "2️⃣ **Data Collection**",
101
+ "description": """
102
+ **Gathering relevant data for model training.
103
+ """
104
+ },
105
+ {
106
+ "title": "3️⃣ **Data Preparation**",
107
+ "description": """
108
+ ** Initial analysis to understand the dataset's basic properties.
109
+ - Steps:
110
+ - Handle missing values and outliers.
111
+ - Normalize or scale numerical features.
112
+ - Encode categorical data (e.g., one-hot encoding).
113
+ - Tools: Python libraries like Pandas, NumPy, or OpenCV for images.
114
+ - Example: Removing null values from a customer dataset.
115
+ """
116
+ },
117
+ {
118
+ "title": "4️⃣ **Feature Engineering**",
119
+ "description": """
120
+ **Select or create the most relevant features for the model.
121
+ - Techniques:
122
+ - Feature Selection: Choose the most important columns (e.g., using correlation).
123
+ - Feature Creation: Combine or transform existing features.
124
+ """
125
+ },
126
+ {
127
+ "title": "5️⃣ **Model Selection**",
128
+ "description": """
129
+ ** Choose the right ML algorithm for your problem.
130
+ - Factors to consider:
131
+ - Problem type: Classification, Regression, Clustering, etc.
132
+ - Data size and structure.
133
+ """
134
+ },
135
+ {
136
+ "title": "6️⃣ **Training**",
137
+ "description": """
138
+ ** Train the ML model using training data.
139
+ - Process:
140
+ - Split data into training and validation sets.
141
+ - Use the training data to fit the model.
142
+ """
143
+ },
144
+ {
145
+ "title": "7️⃣ **Evaluation**",
146
+ "description": """
147
+ ** Assess the model's performance using metrics.
148
+ - Metrics:
149
+ - Classification: Accuracy, Precision, Recall, F1-Score.
150
+ - Regression: Mean Squared Error (MSE), R² Score.
151
+ """
152
+ },
153
+ {
154
+ "title": "8️⃣ **Deployment**",
155
+ "description": """
156
+ ** Integrate the trained model into a production environment.
157
+ - Steps:
158
+ - Create an API for model predictions.
159
+ - Monitor performance on real-world data.
160
+ """
161
+ },
162
+ {
163
+ "title": "9️⃣ **Monitoring & Maintenance**",
164
+ "description": """
165
+ **Ensure the model continues to perform well over time.
166
+ - Monitor:
167
+ - Data drift: Changes in data distribution.
168
+ - Model decay: Performance deterioration.
169
+ """
170
+ },
171
+ ]
172
+
173
+ # Display title and description
174
+ st.title("📊 Machine Learning Life Cycle")
175
+ st.write("Explore the detailed view of life cycle of a Machine Learning project by clicking the steps below:")
176
+
177
+ # Buttons for navigation
178
+ col1, col2, col3 = st.columns([1, 1, 1])
179
+ with col1:
180
+ if st.button("⬅️ Previous", disabled=st.session_state.step == 0):
181
+ st.session_state.step -= 1
182
+ with col3:
183
+ if st.button("➡️ Next", disabled=st.session_state.step == len(ml_lifecycle) - 1):
184
+ st.session_state.step += 1
185
+
186
+ # Display the current lifecycle step with details
187
+ current_step = ml_lifecycle[st.session_state.step]
188
+ st.markdown(f"### {current_step['title']}")
189
+ st.markdown(current_step['description'])
190
+
191
+ # Reset button
192
+ if st.button("🔄 Restart"):
193
+ st.session_state.step = 0
194
  """
195
 
196
  # Render HTML content in Streamlit