LakshmiHarika commited on
Commit
0c7ef36
·
verified ·
1 Parent(s): 20a9d65

Update pages/3Life Cycle of Machine Learning Project.py

Browse files
pages/3Life Cycle of Machine Learning Project.py CHANGED
@@ -8,128 +8,181 @@ st.set_page_config(
8
  )
9
 
10
  # Global CSS for consistent styling across all pages
11
- st.markdown("""
12
  <style>
13
- body, .stApp {
14
- color: #4F4F4F; /* Text color */
15
- background-color: #FFFFFF; /* Background color */
 
 
 
 
 
16
  }
17
- h1, h2, h3, h4, h5, h6 {
18
- color: #BB3385; /* Heading color */
 
 
19
  }
20
- p {
21
- color: #4F4F4F; /* Text color for paragraphs */
 
 
 
 
 
 
 
22
  }
23
- ul li {
24
- color: #4F4F4F; /* List item color */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
  </style>
27
  """, unsafe_allow_html=True)
28
 
29
- # Title of the page
30
- st.markdown("""<div style="text-align: center; margin-top: 20px;"><h1 style="color: #BB3385;">Life Cycle of End to End ML Project</h1></div>""", unsafe_allow_html=True)
31
-
32
- # Inject custom CSS for the circular flowchart layout
33
- st.markdown(
34
- """
35
- <style>
36
- .flowchart-container {
37
- position: relative;
38
- width: 500px; /* Container width */
39
- height: 500px; /* Container height */
40
- margin: 0 auto;
41
- display: flex;
42
- flex-direction: column;
43
- justify-content: center;
44
- align-items: center;
45
- }
46
-
47
- /* Circle arrangement for the phases */
48
- .phase {
49
- position: absolute;
50
- width: 250px; /* Rectangle width */
51
- height: 60px; /* Rectangle height */
52
- border-radius: 8px; /* Rounded edges */
53
- font-size: 16px; /* Text size */
54
- font-weight: bold;
55
- text-align: center;
56
- cursor: pointer;
57
- display: flex;
58
- justify-content: center;
59
- align-items: center;
60
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
61
- transition: transform 0.3s ease, background-color 0.3s ease;
62
- color: black; /* Text color */
63
- }
64
-
65
- /* Color for each phase */
66
- .phase-1 { background-color: #FF7043; top: 0%; left: 50%; transform: translateX(-50%); } /* Red */
67
- .phase-2 { background-color: #42A5F5; top: 25%; left: 90%; transform: translate(-50%, -50%); } /* Blue */
68
- .phase-3 { background-color: #66BB6A; top: 50%; left: 100%; transform: translate(-50%, -50%); } /* Green */
69
- .phase-4 { background-color: #FFEB3B; top: 75%; left: 90%; transform: translate(-50%, -50%); } /* Yellow */
70
- .phase-5 { background-color: #F06292; top: 100%; left: 50%; transform: translateX(-50%); } /* Pink */
71
- .phase-6 { background-color: #42A5F5; top: 75%; left: 10%; transform: translate(-50%, -50%); } /* Blue */
72
- .phase-7 { background-color: #FF7043; top: 50%; left: 0%; transform: translate(-50%, -50%); } /* Red */
73
- .phase-8 { background-color: #66BB6A; top: 25%; left: 10%; transform: translate(-50%, -50%); } /* Green */
74
- .phase-9 { background-color: #FFEB3B; top: 0%; left: 50%; transform: translateX(-50%); } /* Yellow */
75
- .phase-10 { background-color: #F06292; top: 50%; left: 10%; transform: translate(-50%, -50%); } /* Pink */
76
-
77
- .phase:hover {
78
- transform: scale(1.05);
79
- background-color: #F0F0F0; /* Slightly lighter on hover */
80
- }
81
-
82
- .arrow {
83
- font-size: 24px;
84
- color: #4F4F4F;
85
- margin: 20px 0;
86
- }
87
- </style>
88
- """, unsafe_allow_html=True
89
- )
90
-
91
  # HTML structure for the circular flowchart
92
  st.markdown(
93
  """
94
- <div class="flowchart-container">
95
- <!-- Problem Statement -->
96
- <a href="/problem-statement" class="phase phase-1" target="_self">1. Problem Statement</a>
97
- <div class="arrow">⬇️</div>
98
-
99
- <!-- Data Collection -->
100
- <a href="/data-collection" class="phase phase-2" target="_self">2. Data Collection</a>
101
- <div class="arrow">⬇️</div>
102
-
103
- <!-- Simple EDA -->
104
- <a href="/simple-eda" class="phase phase-3" target="_self">3. Simple EDA</a>
105
- <div class="arrow">⬇️</div>
106
-
107
- <!-- Data Preprocessing -->
108
- <a href="/data-preprocessing" class="phase phase-4" target="_self">4. Data Preprocessing</a>
109
- <div class="arrow">⬇️</div>
110
-
111
- <!-- EDA -->
112
- <a href="/eda" class="phase phase-5" target="_self">5. EDA</a>
113
- <div class="arrow">⬇️</div>
114
-
115
- <!-- Feature Engineering -->
116
- <a href="/feature-engineering" class="phase phase-6" target="_self">6. Feature Engineering</a>
117
- <div class="arrow">⬇️</div>
118
-
119
- <!-- Model Training -->
120
- <a href="/model-training" class="phase phase-7" target="_self">7. Training the Model</a>
121
- <div class="arrow">⬇️</div>
122
-
123
- <!-- Model Testing -->
124
- <a href="/model-testing" class="phase phase-8" target="_self">8. Testing the Data</a>
125
- <div class="arrow">⬇️</div>
126
-
127
- <!-- Deployment -->
128
- <a href="/deployment" class="phase phase-9" target="_self">9. Deployment</a>
129
- <div class="arrow">⬇️</div>
130
-
131
- <!-- Monitoring -->
132
- <a href="/monitoring" class="phase phase-10" target="_self">10. Monitoring</a>
133
  </div>
134
  """, unsafe_allow_html=True
135
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  )
9
 
10
  # Global CSS for consistent styling across all pages
11
+ st.markdown("""
12
  <style>
13
+ body {
14
+ font-family: Arial, sans-serif;
15
+ display: flex;
16
+ justify-content: center;
17
+ align-items: center;
18
+ height: 100vh;
19
+ margin: 0;
20
+ background-color: #f4f4f9;
21
  }
22
+ .container {
23
+ text-align: center;
24
+ width: 80%;
25
+ max-width: 800px;
26
  }
27
+ .circle {
28
+ position: relative;
29
+ width: 350px;
30
+ height: 350px;
31
+ margin: 20px auto;
32
+ border-radius: 50%;
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
  }
37
+ .steps {
38
+ position: absolute;
39
+ width: 100%;
40
+ height: 100%;
41
+ display: flex;
42
+ justify-content: center;
43
+ align-items: center;
44
+ flex-wrap: wrap;
45
+ }
46
+ .step {
47
+ background-color: #007bff;
48
+ color: white;
49
+ padding: 15px 30px;
50
+ border-radius: 8px;
51
+ cursor: pointer;
52
+ width: 150px;
53
+ margin: 10px;
54
+ text-align: center;
55
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
56
+ transition: background-color 0.3s;
57
+ position: absolute;
58
+ transform-origin: 50% 50%;
59
+ transition: transform 0.5s ease-in-out;
60
+ }
61
+ .step:hover {
62
+ background-color: #0056b3;
63
+ }
64
+ /* Different background colors for each step */
65
+ #step1 {
66
+ background-color: #ff5733;
67
+ transform: rotate(0deg) translateX(140px) rotate(0deg);
68
+ }
69
+ #step2 {
70
+ background-color: #33b5ff;
71
+ transform: rotate(36deg) translateX(140px) rotate(-36deg);
72
+ }
73
+ #step3 {
74
+ background-color: #33ff57;
75
+ transform: rotate(72deg) translateX(140px) rotate(-72deg);
76
+ }
77
+ #step4 {
78
+ background-color: #ff33cc;
79
+ transform: rotate(108deg) translateX(140px) rotate(-108deg);
80
+ }
81
+ #step5 {
82
+ background-color: #ffcc33;
83
+ transform: rotate(144deg) translateX(140px) rotate(-144deg);
84
+ }
85
+ #step6 {
86
+ background-color: #33ccff;
87
+ transform: rotate(180deg) translateX(140px) rotate(-180deg);
88
+ }
89
+ #step7 {
90
+ background-color: #ff33a1;
91
+ transform: rotate(216deg) translateX(140px) rotate(-216deg);
92
+ }
93
+ #step8 {
94
+ background-color: #66ff33;
95
+ transform: rotate(252deg) translateX(140px) rotate(-252deg);
96
+ }
97
+ #step9 {
98
+ background-color: #9933ff;
99
+ transform: rotate(288deg) translateX(140px) rotate(-288deg);
100
+ }
101
+ #step10 {
102
+ background-color: #f7a500;
103
+ transform: rotate(324deg) translateX(140px) rotate(-324deg);
104
+ }
105
+ /* Rotate steps to form a circular layout */
106
+ #step4 {
107
+ transform: rotate(0deg) translateX(250px) rotate(0deg);
108
+ }
109
+ #step5 {
110
+ transform: rotate(25deg) translateX(250px) rotate(-25deg);
111
+ }
112
+ #step6 {
113
+ transform: rotate(60deg) translateX(250px) rotate(-60deg);
114
+ }
115
+ #step7 {
116
+ transform: rotate(120deg) translateX(250px) rotate(-120deg);
117
+ }
118
+ #step8 {
119
+ transform: rotate(155deg) translateX(250px) rotate(-155deg);
120
+ }
121
+ #step9 {
122
+ transform: rotate(180deg) translateX(250px) rotate(-180deg);
123
+ }
124
+ #step10 {
125
+ transform: rotate(205deg) translateX(250px) rotate(-205deg);
126
+ }
127
+ #step1 {
128
+ transform: rotate(240deg) translateX(250px) rotate(-240deg);
129
+ }
130
+ #step2 {
131
+ transform: rotate(300deg) translateX(250px) rotate(-300deg);
132
+ }
133
+ #step3 {
134
+ transform: rotate(335deg) translateX(250px) rotate(-335deg);
135
+ }
136
+ a {
137
+ color: white; /* Link color */
138
+ text-decoration: none;
139
+ }
140
+ a:hover {
141
+ color: yellow; /* Color on hover */
142
+ text-decoration: underline; /* Underline on hover */
143
  }
144
  </style>
145
  """, unsafe_allow_html=True)
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  # HTML structure for the circular flowchart
148
  st.markdown(
149
  """
150
+ <div class="container">
151
+ <h1>ML Project Life Cycle</h1>
152
+ <div class="circle">
153
+ <div class="steps">
154
+ <div class="step" id="step1">1. Problem Statement</div>
155
+ <div class="step" id="step2">2. Data Collection</div>
156
+ <div class="step" id="step3">3. Simple EDA</div>
157
+ <div class="step" id="step4">4. Data Pre-Processing</div>
158
+ <div class="step" id="step5">5. EDA</div>
159
+ <div class="step" id="step6">6. Feature Engineering</div>
160
+ <div class="step" id="step7">7. Training the Model</div>
161
+ <div class="step" id="step8">8. Testing the Data</div>
162
+ <div class="step" id="step9">9. Deployment</div>
163
+ <div class="step" id="step10">10. Monitoring</div>
164
+ </div>
165
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  </div>
167
  """, unsafe_allow_html=True
168
  )
169
+
170
+ # Define descriptions for each phase
171
+ descriptions = {
172
+ '1. Problem Statement' : "Clearly define the issue, the data used, and the expected outcome.",
173
+ '2. Data Collection': "Collect relevant data from various sources like APIs, databases, and user-generated content.",
174
+ '3. Simple EDA': "Perform initial exploratory analysis to assess data quality, structure, and appearance.",
175
+ '4. Data Pre-Processing': "Clean the dataset by handling missing values, outliers, and inconsistencies.",
176
+ '5. EDA': "Perform detailed analysis to uncover trends, patterns, and relationships in the data.",
177
+ '6. Feature Engineering': "Create or select meaningful features, scale variables, and reduce dimensionality.",
178
+ '7. Training the Model': "Train machine learning models on the prepared dataset and optimize parameters.",
179
+ '8. Testing the Data': "Evaluate the trained model on a validation dataset to assess performance.",
180
+ '9. Deployment': "Deploy the model into a live system for real-time or batch processing of new data.",
181
+ '10. Monitoring': "Track model performance, handling issues like data drift and model degradation."
182
+ }
183
+
184
+ # Create a navigation menu using a selectbox
185
+ step = st.selectbox('Select a step in the machine learning life cycle:', list(descriptions.keys()))
186
+
187
+ # Display the description for the selected step
188
+ st.write(descriptions[step])