Spaces:
Sleeping
Sleeping
Update pages/Life_cycle_of_ML.py
Browse files- pages/Life_cycle_of_ML.py +83 -83
pages/Life_cycle_of_ML.py
CHANGED
@@ -1,91 +1,91 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
#
|
4 |
-
|
5 |
-
# Life Cycle of ML
|
6 |
-
|
7 |
-
The life cycle of Machine Learning (ML) involves several stages, from defining the problem to deploying and monitoring the model. Here's an overview of each stage:
|
8 |
-
|
9 |
-
1. **Problem Statement:** Understanding the problem and setting objectives for the ML model.
|
10 |
-
2. **Data Collection:** Gathering relevant data for model training.
|
11 |
-
3. **Simple EDA (Exploratory Data Analysis):** Initial analysis to understand the dataset's basic properties.
|
12 |
-
4. **Data Preprocessing:** Cleaning the data to ensure it's in a usable format.
|
13 |
-
5. **EDA (Exploratory Data Analysis):** Deeper analysis to gain insights and find patterns in the data.
|
14 |
-
6. **Feature Engineering:** Creating new features or modifying existing ones to improve model performance.
|
15 |
-
7. **Training:** Training machine learning models using the processed data.
|
16 |
-
8. **Testing:** Evaluating the trained model using a test set to assess its performance.
|
17 |
-
9. **Deploying:** Deploying the model to a production environment.
|
18 |
-
10. **Monitoring:** Continuously monitoring the model's performance in the production environment.
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
<
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
<line x1="580" y1="375" x2="325" y2="500" stroke="#000" marker-end="url(#arrow)" />
|
79 |
-
|
80 |
-
<!-- Define arrow marker -->
|
81 |
-
<defs>
|
82 |
-
<marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="4" markerHeight="4" orient="auto">
|
83 |
-
<polygon points="0,0 10,5 0,10" fill="#000" />
|
84 |
-
</marker>
|
85 |
-
</defs>
|
86 |
</svg>
|
87 |
"""
|
88 |
|
89 |
-
# Render
|
90 |
st.markdown(html_content, unsafe_allow_html=True)
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Render the life cycle process with interactive buttons
|
4 |
+
st.title("Machine Learning Life Cycle")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
# HTML content inside a string for correct SVG rendering
|
7 |
+
html_content = """
|
8 |
+
<svg width="800" height="650">
|
9 |
+
<!-- Problem Statement -->
|
10 |
+
<rect x="50" y="50" width="200" height="50" fill="#FFB6C1" stroke="#000" />
|
11 |
+
<text x="75" y="80" fill="#000" font-size="14" text-anchor="middle">Problem Statement</text>
|
12 |
+
|
13 |
+
<!-- Data Collection -->
|
14 |
+
<circle cx="400" cy="75" r="50" fill="#ADD8E6" stroke="#000" />
|
15 |
+
<text x="400" y="80" fill="#000" font-size="14" text-anchor="middle">Data Collection</text>
|
16 |
+
|
17 |
+
<!-- Simple EDA -->
|
18 |
+
<ellipse cx="700" cy="75" rx="100" ry="50" fill="#90EE90" stroke="#000" />
|
19 |
+
<text x="700" y="80" fill="#000" font-size="14" text-anchor="middle">Simple EDA</text>
|
20 |
+
|
21 |
+
<!-- Data Preprocessing -->
|
22 |
+
<rect x="50" y="200" width="200" height="50" fill="#FFD700" stroke="#000" />
|
23 |
+
<text x="150" y="230" fill="#000" font-size="14" text-anchor="middle">Data Preprocessing</text>
|
24 |
+
|
25 |
+
<!-- EDA -->
|
26 |
+
<circle cx="400" cy="225" r="50" fill="#FF7F50" stroke="#000" />
|
27 |
+
<text x="400" y="230" fill="#000" font-size="14" text-anchor="middle">EDA</text>
|
28 |
+
|
29 |
+
<!-- Feature Engineering -->
|
30 |
+
<ellipse cx="700" cy="225" rx="100" ry="50" fill="#9370DB" stroke="#000" />
|
31 |
+
<text x="700" y="230" fill="#000" font-size="14" text-anchor="middle">Feature Engineering</text>
|
32 |
+
|
33 |
+
<!-- Training -->
|
34 |
+
<rect x="50" y="350" width="200" height="50" fill="#FF6347" stroke="#000" />
|
35 |
+
<text x="150" y="380" fill="#000" font-size="14" text-anchor="middle">Training</text>
|
36 |
+
|
37 |
+
<!-- Testing -->
|
38 |
+
<circle cx="400" cy="375" r="50" fill="#98FB98" stroke="#000" />
|
39 |
+
<text x="400" y="380" fill="#000" font-size="14" text-anchor="middle">Testing</text>
|
40 |
+
|
41 |
+
<!-- Deploying -->
|
42 |
+
<ellipse cx="700" cy="375" rx="100" ry="50" fill="#F0E68C" stroke="#000" />
|
43 |
+
<text x="700" y="380" fill="#000" font-size="14" text-anchor="middle">Deploying</text>
|
44 |
+
|
45 |
+
<!-- Monitoring -->
|
46 |
+
<rect x="350" y="500" width="200" height="50" fill="#B0E0E6" stroke="#000" />
|
47 |
+
<text x="450" y="530" fill="#000" font-size="14" text-anchor="middle">Monitoring</text>
|
48 |
+
|
49 |
+
<!-- Arrows -->
|
50 |
+
<line x1="250" y1="75" x2="350" y2="75" stroke="#000" marker-end="url(#arrow)" />
|
51 |
+
<line x1="450" y1="75" x2="600" y2="75" stroke="#000" marker-end="url(#arrow)" />
|
52 |
+
<line x1="250" y1="225" x2="350" y2="225" stroke="#000" marker-end="url(#arrow)" />
|
53 |
+
<line x1="450" y1="225" x2="600" y2="225" stroke="#000" marker-end="url(#arrow)" />
|
54 |
+
<line x1="250" y1="375" x2="350" y2="375" stroke="#000" marker-end="url(#arrow)" />
|
55 |
+
<line x1="450" y1="375" x2="600" y2="375" stroke="#000" marker-end="url(#arrow)" />
|
56 |
+
<line x1="600" y1="375" x2="450" y2="500" stroke="#000" marker-end="url(#arrow)" />
|
57 |
+
|
58 |
+
<!-- Define arrow marker -->
|
59 |
+
<defs>
|
60 |
+
<marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="4" markerHeight="4" orient="auto">
|
61 |
+
<polygon points="0,0 10,5 0,10" fill="#000" />
|
62 |
+
</marker>
|
63 |
+
</defs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
</svg>
|
65 |
"""
|
66 |
|
67 |
+
# Render the SVG
|
68 |
st.markdown(html_content, unsafe_allow_html=True)
|
69 |
|
70 |
+
# Interactive buttons for stages
|
71 |
+
st.subheader("Stages in ML Life Cycle")
|
72 |
+
if st.button("Problem Statement"):
|
73 |
+
st.write("Understanding the problem and setting objectives for the ML model.")
|
74 |
+
if st.button("Data Collection"):
|
75 |
+
st.write("Gathering relevant data for model training.")
|
76 |
+
if st.button("Simple EDA"):
|
77 |
+
st.write("Initial analysis to understand the dataset's basic properties.")
|
78 |
+
if st.button("Data Preprocessing"):
|
79 |
+
st.write("Cleaning the data to ensure it's in a usable format.")
|
80 |
+
if st.button("EDA"):
|
81 |
+
st.write("Deeper analysis to gain insights and find patterns in the data.")
|
82 |
+
if st.button("Feature Engineering"):
|
83 |
+
st.write("Creating new features or modifying existing ones to improve model performance.")
|
84 |
+
if st.button("Training"):
|
85 |
+
st.write("Training machine learning models using the processed data.")
|
86 |
+
if st.button("Testing"):
|
87 |
+
st.write("Evaluating the trained model using a test set to assess its performance.")
|
88 |
+
if st.button("Deploying"):
|
89 |
+
st.write("Deploying the model to a production environment.")
|
90 |
+
if st.button("Monitoring"):
|
91 |
+
st.write("Continuously monitoring the model's performance in the production environment.")
|