Harika22 commited on
Commit
06af333
·
verified ·
1 Parent(s): ae03b0c

Update pages/3_Life cycle of ML.py

Browse files
Files changed (1) hide show
  1. pages/3_Life cycle of ML.py +49 -49
pages/3_Life cycle of ML.py CHANGED
@@ -1,84 +1,84 @@
1
  import streamlit as st
2
 
3
- # Initialize session state
4
  if "page" not in st.session_state:
5
  st.session_state.page = "main"
6
 
7
- # Navigation function
8
  def navigate_to(page_name):
9
  st.session_state.page = page_name
10
 
11
  # Main page
12
  if st.session_state.page == "main":
13
- # Page header
14
  st.markdown(
15
  """
16
- <div style="background-color: #f0f0f5; padding: 10px; border-radius: 5px; text-align: center;">
17
- <h2 style="color: #4a90e2; font-family: Arial, sans-serif;">ML Project Life Cycle</h2>
18
  </div>
19
  """,
20
- unsafe_allow_html=True,
21
  )
22
 
23
- # Circular Life Cycle Visualization
24
  html_code = """
25
- <div style="display: flex; justify-content: center; align-items: center; margin: 20px;">
26
- <div style="position: relative; width: 350px; height: 350px; border-radius: 50%;">
27
- <div style="position: absolute; width: 100%; height: 100%;">
28
- <div style="position: absolute; transform: rotate(0deg) translateX(130px);">
29
- <div style="background: #ff5733; color: white; padding: 10px; border-radius: 5px; text-align: center;">Problem Statement</div>
30
- </div>
31
- <div style="position: absolute; transform: rotate(36deg) translateX(130px);">
32
- <div style="background: #33b5ff; color: white; padding: 10px; border-radius: 5px; text-align: center;">Data Collection</div>
33
- </div>
34
- <div style="position: absolute; transform: rotate(72deg) translateX(130px);">
35
- <div style="background: #33ff57; color: white; padding: 10px; border-radius: 5px; text-align: center;">Simple EDA</div>
36
- </div>
37
- <div style="position: absolute; transform: rotate(108deg) translateX(130px);">
38
- <div style="background: #ff33cc; color: white; padding: 10px; border-radius: 5px; text-align: center;">Data Pre-Processing</div>
39
  </div>
40
- <div style="position: absolute; transform: rotate(144deg) translateX(130px);">
41
- <div style="background: #ffcc33; color: white; padding: 10px; border-radius: 5px; text-align: center;">EDA</div>
 
 
42
  </div>
43
- <div style="position: absolute; transform: rotate(180deg) translateX(130px);">
44
- <div style="background: #33ccff; color: white; padding: 10px; border-radius: 5px; text-align: center;">Feature Engineering</div>
 
 
45
  </div>
46
- <div style="position: absolute; transform: rotate(216deg) translateX(130px);">
47
- <div style="background: #ff33a1; color: white; padding: 10px; border-radius: 5px; text-align: center;">Training</div>
 
 
48
  </div>
49
- <div style="position: absolute; transform: rotate(252deg) translateX(130px);">
50
- <div style="background: #66ff33; color: white; padding: 10px; border-radius: 5px; text-align: center;">Testing</div>
 
 
51
  </div>
52
- <div style="position: absolute; transform: rotate(288deg) translateX(130px);">
53
- <div style="background: #9933ff; color: white; padding: 10px; border-radius: 5px; text-align: center;">Deployment</div>
 
 
54
  </div>
55
- <div style="position: absolute; transform: rotate(324deg) translateX(130px);">
56
- <div style="background: #f7a500; color: white; padding: 10px; border-radius: 5px; text-align: center;">Monitoring</div>
 
 
57
  </div>
58
  </div>
59
  </div>
60
  </div>
61
  """
 
62
  st.markdown(html_code, unsafe_allow_html=True)
63
 
64
- # Descriptions
65
  descriptions = {
66
- "Problem Statement": "Define the goal of the ML model.",
67
- "Data Collection": "Gather data from various sources.",
68
- "Simple EDA": "Identify missing values and outliers.",
69
- "Data Pre-Processing": "Clean and transform the data.",
70
- "EDA": "Gain insights through visualizations.",
71
- "Feature Engineering": "Extract and create useful features.",
72
- "Training": "Train the model with prepared data.",
73
- "Testing": "Evaluate the model's performance.",
74
- "Deployment": "Deploy the model for real-world use.",
75
- "Monitoring": "Track and update model performance."
76
  }
77
 
78
- # Select step
79
- step = st.selectbox("Select a step to learn more:", descriptions.keys())
80
- st.write(f"**{step}:** {descriptions[step]}")
81
 
82
- # Additional navigation for Data Collection
83
- if step == "Data Collection" and st.button("Learn More About Data Collection"):
84
  navigate_to("data_collection")
 
1
  import streamlit as st
2
 
3
+ # Initialize session state for navigation
4
  if "page" not in st.session_state:
5
  st.session_state.page = "main"
6
 
 
7
  def navigate_to(page_name):
8
  st.session_state.page = page_name
9
 
10
  # Main page
11
  if st.session_state.page == "main":
 
12
  st.markdown(
13
  """
14
+ <div style="background-color: #f0f0f5; padding: 15px; border-radius: 10px; text-align: center;">
15
+ <h2 style="color: #4a90e2; font-family: Arial, sans-serif;">Machine Learning Project Life Cycle</h2>
16
  </div>
17
  """,
18
+ unsafe_allow_html=True
19
  )
20
 
21
+ # Circular visualization of ML lifecycle
22
  html_code = """
23
+ <div style="display: flex; justify-content: center; align-items: center; height: auto;">
24
+ <div style="position: relative; width: 350px; height: 350px; border: 3px solid #4a90e2; border-radius: 50%;">
25
+ <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center;">
26
+ <h4 style="color: #4a90e2;">ML Steps</h4>
27
+ </div>
28
+ <div style="position: absolute; top: 10%; left: 50%; transform: translate(-50%, -50%);">
29
+ <div style="background-color: #ff5733; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
30
+ 1. Problem Statement
 
 
 
 
 
 
31
  </div>
32
+ </div>
33
+ <div style="position: absolute; top: 30%; left: 85%; transform: translate(-50%, -50%);">
34
+ <div style="background-color: #33b5ff; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
35
+ 2. Data Collection
36
  </div>
37
+ </div>
38
+ <div style="position: absolute; top: 70%; left: 85%; transform: translate(-50%, -50%);">
39
+ <div style="background-color: #33ff57; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
40
+ 3. Simple EDA
41
  </div>
42
+ </div>
43
+ <div style="position: absolute; top: 90%; left: 50%; transform: translate(-50%, -50%);">
44
+ <div style="background-color: #ff33cc; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
45
+ 4. Data Pre-Processing
46
  </div>
47
+ </div>
48
+ <div style="position: absolute; top: 70%; left: 15%; transform: translate(-50%, -50%);">
49
+ <div style="background-color: #ffcc33; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
50
+ 5. EDA
51
  </div>
52
+ </div>
53
+ <div style="position: absolute; top: 30%; left: 15%; transform: translate(-50%, -50%);">
54
+ <div style="background-color: #33ccff; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
55
+ 6. Feature Engineering
56
  </div>
57
+ </div>
58
+ <div style="position: absolute; top: 10%; left: 50%; transform: translate(-50%, -50%);">
59
+ <div style="background-color: #ff33a1; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
60
+ 7. Training the Model
61
  </div>
62
  </div>
63
  </div>
64
  </div>
65
  """
66
+
67
  st.markdown(html_code, unsafe_allow_html=True)
68
 
69
+ # Descriptions for each step
70
  descriptions = {
71
+ "1. Problem Statement": "**Define the aim or goal of your ML model.**",
72
+ "2. Data Collection": "**Gather data from various sources like APIs, web scraping, etc.**",
73
+ "3. Simple EDA": "**Explore data for missing values and outliers.**",
74
+ "4. Data Pre-Processing": "**Clean and transform the data.**",
75
+ "5. EDA": "**Gain deeper insights and visualize the data.**",
76
+ "6. Feature Engineering": "**Create new features for better model performance.**",
77
+ "7. Training the Model": "**Train your model using the prepared dataset.**"
 
 
 
78
  }
79
 
80
+ step = st.selectbox("Select a step in the ML lifecycle to learn more:", list(descriptions.keys()))
81
+ st.write(descriptions[step])
 
82
 
83
+ if st.button("Learn More About Data Collection"):
 
84
  navigate_to("data_collection")