Spaces:
Sleeping
Sleeping
Update pages/Life_cycle_of_ML.py
Browse files- 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 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|