Sathwikchowdary commited on
Commit
c500a02
·
verified ·
1 Parent(s): d8f9eb5

Update pages/Life_cycle_of_ML.py

Browse files
Files changed (1) hide show
  1. pages/Life_cycle_of_ML.py +77 -44
pages/Life_cycle_of_ML.py CHANGED
@@ -1,58 +1,91 @@
1
- ## Shapes Representing the ML Life Cycle
2
 
3
- <svg width="600" height="300">
4
- <!-- Problem Definition (Rectangle) -->
5
- <rect x="50" y="50" width="150" height="50" fill="#FFB6C1" stroke="#000" />
6
- <text x="75" y="80" fill="#000" font-size="14">Problem Definition</text>
7
-
8
- <!-- Data Collection (Circle) -->
9
- <circle cx="300" cy="75" r="40" fill="#ADD8E6" stroke="#000" />
10
- <text x="270" y="80" fill="#000" font-size="14">Data Collection</text>
11
-
12
- <!-- Data Preprocessing (Ellipse) -->
13
- <ellipse cx="500" cy="75" rx="80" ry="40" fill="#90EE90" stroke="#000" />
14
- <text x="445" y="80" fill="#000" font-size="14">Data Preprocessing</text>
15
-
16
- <!-- Arrows between Problem Definition and Data Collection -->
17
- <line x1="200" y1="75" x2="260" y2="75" stroke="#000" marker-end="url(#arrow)" />
18
-
19
- <!-- Model Building (Rectangle) -->
20
- <rect x="50" y="200" width="150" height="50" fill="#FFD700" stroke="#000" />
21
- <text x="75" y="230" fill="#000" font-size="14">Model Building</text>
22
-
23
- <!-- Evaluation (Circle) -->
24
- <circle cx="300" cy="225" r="40" fill="#FF7F50" stroke="#000" />
25
- <text x="275" y="230" fill="#000" font-size="14">Evaluation</text>
26
-
27
- <!-- Deployment (Rectangle) -->
28
- <rect x="450" y="200" width="150" height="50" fill="#9370DB" stroke="#000" />
29
- <text x="475" y="230" fill="#000" font-size="14">Deployment</text>
30
-
31
- <!-- Arrows between Model Building, Evaluation, and Deployment -->
32
- <line x1="125" y1="250" x2="260" y2="225" stroke="#000" marker-end="url(#arrow)" />
33
- <line x1="340" y1="225" x2="450" y2="225" stroke="#000" marker-end="url(#arrow)" />
34
-
35
- <!-- Define arrow marker -->
36
- <defs>
37
- <marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="4" markerHeight="4" orient="auto">
38
- <polygon points="0,0 10,5 0,10" fill="#000" />
39
- </marker>
40
- </defs>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  </svg>
42
  """
43
- # Render HTML content in Streamlit
44
- st.markdown(html_content, unsafe_allow_html=True)
45
- # Render the SVG
46
  st.markdown(html_content, unsafe_allow_html=True)
47
- # Interactive buttons for stages
48
- st.subheader("Stages in ML Life Cycle")
 
 
49
  if st.button("Problem Statement"):
 
50
  if st.button("Data Collection"):
 
51
  if st.button("Simple EDA"):
 
52
  if st.button("Data Preprocessing"):
 
53
  if st.button("EDA"):
 
54
  if st.button("Feature Engineering"):
 
55
  if st.button("Training"):
 
56
  if st.button("Testing"):
 
57
  if st.button("Deploying"):
 
58
  if st.button("Monitoring"):
 
 
1
+ import streamlit as st
2
 
3
+ # HTML content for the ML life cycle diagram
4
+ html_content = """
5
+ <h2 style="text-align: center;">Life Cycle of Machine Learning</h2>
6
+
7
+ <svg width="800" height="650">
8
+ <!-- Problem Statement -->
9
+ <rect x="50" y="50" width="200" height="50" fill="#FFB6C1" stroke="#000" />
10
+ <text x="150" y="80" fill="#000" font-size="14" text-anchor="middle">Problem Statement</text>
11
+
12
+ <!-- Data Collection -->
13
+ <circle cx="400" cy="75" r="50" fill="#ADD8E6" stroke="#000" />
14
+ <text x="400" y="80" fill="#000" font-size="14" text-anchor="middle">Data Collection</text>
15
+
16
+ <!-- Simple EDA -->
17
+ <ellipse cx="700" cy="75" rx="100" ry="50" fill="#90EE90" stroke="#000" />
18
+ <text x="700" y="80" fill="#000" font-size="14" text-anchor="middle">Simple EDA</text>
19
+
20
+ <!-- Data Preprocessing -->
21
+ <rect x="50" y="200" width="200" height="50" fill="#FFD700" stroke="#000" />
22
+ <text x="150" y="230" fill="#000" font-size="14" text-anchor="middle">Data Preprocessing</text>
23
+
24
+ <!-- EDA -->
25
+ <circle cx="400" cy="225" r="50" fill="#FF7F50" stroke="#000" />
26
+ <text x="400" y="230" fill="#000" font-size="14" text-anchor="middle">EDA</text>
27
+
28
+ <!-- Feature Engineering -->
29
+ <ellipse cx="700" cy="225" rx="100" ry="50" fill="#9370DB" stroke="#000" />
30
+ <text x="700" y="230" fill="#000" font-size="14" text-anchor="middle">Feature Engineering</text>
31
+
32
+ <!-- Training -->
33
+ <rect x="50" y="350" width="200" height="50" fill="#FF6347" stroke="#000" />
34
+ <text x="150" y="380" fill="#000" font-size="14" text-anchor="middle">Training</text>
35
+
36
+ <!-- Testing -->
37
+ <circle cx="400" cy="375" r="50" fill="#98FB98" stroke="#000" />
38
+ <text x="400" y="380" fill="#000" font-size="14" text-anchor="middle">Testing</text>
39
+
40
+ <!-- Deploying -->
41
+ <ellipse cx="700" cy="375" rx="100" ry="50" fill="#F0E68C" stroke="#000" />
42
+ <text x="700" y="380" fill="#000" font-size="14" text-anchor="middle">Deploying</text>
43
+
44
+ <!-- Monitoring -->
45
+ <rect x="350" y="500" width="200" height="50" fill="#B0E0E6" stroke="#000" />
46
+ <text x="450" y="530" fill="#000" font-size="14" text-anchor="middle">Monitoring</text>
47
+
48
+ <!-- Arrows -->
49
+ <line x1="250" y1="75" x2="350" y2="75" stroke="#000" marker-end="url(#arrow)" />
50
+ <line x1="450" y1="75" x2="600" y2="75" stroke="#000" marker-end="url(#arrow)" />
51
+ <line x1="250" y1="225" x2="350" y2="225" stroke="#000" marker-end="url(#arrow)" />
52
+ <line x1="450" y1="225" x2="600" y2="225" stroke="#000" marker-end="url(#arrow)" />
53
+ <line x1="250" y1="375" x2="350" y2="375" stroke="#000" marker-end="url(#arrow)" />
54
+ <line x1="450" y1="375" x2="600" y2="375" stroke="#000" marker-end="url(#arrow)" />
55
+ <line x1="600" y1="375" x2="450" y2="500" stroke="#000" marker-end="url(#arrow)" />
56
+
57
+ <!-- Define arrow marker -->
58
+ <defs>
59
+ <marker id="arrow" viewBox="0 0 10 10" refX="5" refY="5" markerWidth="4" markerHeight="4" orient="auto">
60
+ <polygon points="0,0 10,5 0,10" fill="#000" />
61
+ </marker>
62
+ </defs>
63
  </svg>
64
  """
65
+
66
+ # Display the diagram
 
67
  st.markdown(html_content, unsafe_allow_html=True)
68
+
69
+ # Add buttons for interaction
70
+ st.subheader("Interactive ML Life Cycle")
71
+
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.")