LakshmiHarika commited on
Commit
84f6905
·
verified ·
1 Parent(s): 4b73ce5

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

Browse files
pages/3Life Cycle of Machine Learning Project.py CHANGED
@@ -1,143 +1,118 @@
1
 
2
  import streamlit as st
3
 
 
4
  st.set_page_config(
5
- page_title="HomePage",
6
- page_icon="🚀",
7
  layout="wide"
8
  )
9
 
10
- # Global CSS for consistent styling across all pages
11
- st.markdown("""
12
  <style>
13
- body, .stApp {
14
- color: #4F4F4F; /* Replace with your desired font color */
15
- background-color: #FFFFFF; /* Optional: Set a fixed background color */
16
- }
17
- h1, h2, h3, h4, h5, h6 {
18
- color: #BB3385; /* Replace with your heading color */
19
- }
20
- p {
21
- color: #4F4F4F; /* Replace with your paragraph text color */
22
- }
23
- ul li {
24
- color: #4F4F4F; /* List item color */
25
- }
26
  </style>
27
  """, unsafe_allow_html=True)
28
 
29
- # Circular flowchart styles
30
  st.markdown(
31
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  <style>
33
  .circle-container {
34
- position: relative;
35
- width: 400px;
36
- height: 400px;
37
- margin: 0 auto;
38
- border-radius: 50%;
39
  display: flex;
40
  justify-content: center;
41
  align-items: center;
42
- }
43
- .steps {
44
- position: absolute;
45
- width: 100%;
46
  height: 100%;
47
- display: flex;
48
- justify-content: center;
49
- align-items: center;
50
- flex-wrap: wrap;
 
 
 
51
  }
52
  .step {
 
 
 
53
  background-color: #007bff;
54
  color: white;
55
- padding: 15px 30px;
56
- border-radius: 8px;
57
- cursor: pointer;
58
- width: 150px;
59
- margin: 10px;
60
  text-align: center;
61
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
62
- transition: background-color 0.3s;
63
- position: absolute;
64
- transform-origin: 50% 50%;
65
- transition: transform 0.5s ease-in-out;
66
  }
67
  .step:hover {
68
  background-color: #0056b3;
69
  }
70
-
71
- /* Different colors and rotations for each step */
72
- #step1 {
73
- background-color: #ff5733;
74
- transform: rotate(0deg) translateX(170px) rotate(0deg);
75
- }
76
- #step2 {
77
- background-color: #33b5ff;
78
- transform: rotate(36deg) translateX(170px) rotate(-36deg);
79
- }
80
- #step3 {
81
- background-color: #33ff57;
82
- transform: rotate(72deg) translateX(170px) rotate(-72deg);
83
- }
84
- #step4 {
85
- background-color: #ff33cc;
86
- transform: rotate(108deg) translateX(170px) rotate(-108deg);
87
- }
88
- #step5 {
89
- background-color: #ffcc33;
90
- transform: rotate(144deg) translateX(170px) rotate(-144deg);
91
- }
92
- #step6 {
93
- background-color: #33ccff;
94
- transform: rotate(180deg) translateX(170px) rotate(-180deg);
95
- }
96
- #step7 {
97
- background-color: #ff33a1;
98
- transform: rotate(216deg) translateX(170px) rotate(-216deg);
99
- }
100
- #step8 {
101
- background-color: #66ff33;
102
- transform: rotate(252deg) translateX(170px) rotate(-252deg);
103
- }
104
- #step9 {
105
- background-color: #9933ff;
106
- transform: rotate(288deg) translateX(170px) rotate(-288deg);
107
- }
108
- #step10 {
109
- background-color: #f7a500;
110
- transform: rotate(324deg) translateX(170px) rotate(-324deg);
111
- }
112
  </style>
113
- """, unsafe_allow_html=True)
114
-
115
- # Title of the page
116
- 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)
117
-
118
- # Circular Flowchart HTML structure for ML Project Phases
119
- st.markdown(
120
- """
121
  <div class="circle-container">
122
- <div class="steps">
123
- <div class="step" id="step1">1. Problem Statement</div>
124
- <div class="step" id="step2">2. Data Collection</div>
125
- <div class="step" id="step3">3. Simple EDA</div>
126
- <div class="step" id="step4">4. Data Pre-Processing</div>
127
- <div class="step" id="step5">5. EDA</div>
128
- <div class="step" id="step6">6. Feature Engineering</div>
129
- <div class="step" id="step7">7. Training the Model</div>
130
- <div class="step" id="step8">8. Testing the Model</div>
131
- <div class="step" id="step9">9. Deployment</div>
132
- <div class="step" id="step10">10. Monitoring</div>
133
  </div>
134
  </div>
135
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
136
 
137
- # Additional spacing
138
- st.write(' ')
139
- st.write(' ')
140
- st.write(' ')
141
- st.write(' ')
142
- st.write(' ')
143
- st.write(' ')
 
1
 
2
  import streamlit as st
3
 
4
+ # Set the Streamlit page configuration
5
  st.set_page_config(
6
+ page_title="ML Life Cycle",
7
+ page_icon="🔄",
8
  layout="wide"
9
  )
10
 
11
+ # Global CSS styling
12
+ st.markdown("""
13
  <style>
14
+ body, .stApp {
15
+ font-family: Arial, sans-serif;
16
+ color: #4F4F4F; /* Default text color */
17
+ background-color: #FFFFFF;
18
+ }
19
+ h1, h2, h3, h4 {
20
+ color: #BB3385;
21
+ }
 
 
 
 
 
22
  </style>
23
  """, unsafe_allow_html=True)
24
 
25
+ # Display page title
26
  st.markdown(
27
+ "<h1 style='text-align: center; color: #BB3385;'>Machine Learning Project Life Cycle</h1>",
28
+ unsafe_allow_html=True
29
+ )
30
+
31
+ # Define step descriptions
32
+ descriptions = {
33
+ '1. Problem Statement': "**Problem Statement**: Define the objective of the ML project and establish goals for the model.",
34
+ '2. Data Collection': "**Data Collection**: Gather data from reliable sources such as APIs, web scraping, or datasets.",
35
+ '3. Simple EDA': "**Simple EDA**: Perform quick exploratory analysis to identify missing values and outliers.",
36
+ '4. Data Preprocessing': "**Data Preprocessing**: Clean the data and prepare it for analysis and modeling.",
37
+ '5. EDA': "**EDA**: Perform detailed analysis to uncover patterns, relationships, and trends.",
38
+ '6. Feature Engineering': "**Feature Engineering**: Create new features or transform existing ones for better model accuracy.",
39
+ '7. Model Training': "**Model Training**: Train machine learning models using the prepared data.",
40
+ '8. Model Testing': "**Model Testing**: Evaluate the model's performance using metrics like accuracy or recall.",
41
+ '9. Deployment': "**Deployment**: Deploy the model for real-world usage in production environments.",
42
+ '10. Monitoring': "**Monitoring**: Continuously monitor model performance and update it as required."
43
+ }
44
+
45
+ # Circular layout HTML and CSS
46
+ circle_html = """
47
+ <!DOCTYPE html>
48
+ <html lang="en">
49
+ <head>
50
+ <meta charset="UTF-8">
51
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
52
  <style>
53
  .circle-container {
 
 
 
 
 
54
  display: flex;
55
  justify-content: center;
56
  align-items: center;
 
 
 
 
57
  height: 100%;
58
+ margin-top: 50px;
59
+ }
60
+ .circle {
61
+ position: relative;
62
+ width: 400px;
63
+ height: 400px;
64
+ border-radius: 50%;
65
  }
66
  .step {
67
+ position: absolute;
68
+ width: 150px;
69
+ height: 50px;
70
  background-color: #007bff;
71
  color: white;
 
 
 
 
 
72
  text-align: center;
73
+ line-height: 50px;
74
+ border-radius: 8px;
75
+ transform-origin: 200px 200px;
 
 
76
  }
77
  .step:hover {
78
  background-color: #0056b3;
79
  }
80
+ .step:nth-child(1) { transform: rotate(0deg) translate(200px) rotate(0deg); }
81
+ .step:nth-child(2) { transform: rotate(36deg) translate(200px) rotate(-36deg); }
82
+ .step:nth-child(3) { transform: rotate(72deg) translate(200px) rotate(-72deg); }
83
+ .step:nth-child(4) { transform: rotate(108deg) translate(200px) rotate(-108deg); }
84
+ .step:nth-child(5) { transform: rotate(144deg) translate(200px) rotate(-144deg); }
85
+ .step:nth-child(6) { transform: rotate(180deg) translate(200px) rotate(-180deg); }
86
+ .step:nth-child(7) { transform: rotate(216deg) translate(200px) rotate(-216deg); }
87
+ .step:nth-child(8) { transform: rotate(252deg) translate(200px) rotate(-252deg); }
88
+ .step:nth-child(9) { transform: rotate(288deg) translate(200px) rotate(-288deg); }
89
+ .step:nth-child(10) { transform: rotate(324deg) translate(200px) rotate(-324deg); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  </style>
91
+ </head>
92
+ <body>
 
 
 
 
 
 
93
  <div class="circle-container">
94
+ <div class="circle">
95
+ <div class="step">1. Problem Statement</div>
96
+ <div class="step">2. Data Collection</div>
97
+ <div class="step">3. Simple EDA</div>
98
+ <div class="step">4. Data Preprocessing</div>
99
+ <div class="step">5. EDA</div>
100
+ <div class="step">6. Feature Engineering</div>
101
+ <div class="step">7. Model Training</div>
102
+ <div class="step">8. Model Testing</div>
103
+ <div class="step">9. Deployment</div>
104
+ <div class="step">10. Monitoring</div>
105
  </div>
106
  </div>
107
+ </body>
108
+ </html>
109
+ """
110
+
111
+ # Render the HTML layout in Streamlit
112
+ st.markdown(circle_html, unsafe_allow_html=True)
113
+
114
+ # Sidebar for selecting a step
115
+ selected_step = st.sidebar.selectbox("Select a step:", list(descriptions.keys()))
116
 
117
+ # Display the description for the selected step
118
+ st.write(descriptions[selected_step])