Harika22 commited on
Commit
ae03b0c
·
verified ·
1 Parent(s): 95490c5

Update pages/3_Life cycle of ML.py

Browse files
Files changed (1) hide show
  1. pages/3_Life cycle of ML.py +63 -61
pages/3_Life cycle of ML.py CHANGED
@@ -4,79 +4,81 @@ import streamlit as st
4
  if "page" not in st.session_state:
5
  st.session_state.page = "main"
6
 
7
- # Function to navigate between pages
8
  def navigate_to(page_name):
9
  st.session_state.page = page_name
10
 
11
- # Page content
12
  if st.session_state.page == "main":
 
13
  st.markdown(
14
  """
15
- <div style="text-align: center; margin-top: 20px;">
16
- <h2 style="color: #4a90e2; font-family: Arial, sans-serif;">Machine Learning Project Life Cycle</h2>
17
  </div>
18
  """,
19
  unsafe_allow_html=True,
20
  )
21
 
22
- # Life cycle steps with descriptions
23
- steps = [
24
- ("Problem Statement", "Define the aim/goal of the ML model."),
25
- ("Data Collection", "Gather data from sources like APIs, web scraping, or Kaggle."),
26
- ("Simple EDA", "Quickly explore the data for missing values and outliers."),
27
- ("Data Pre-Processing", "Clean and transform the data for model readiness."),
28
- ("EDA", "Visualize and analyze data for deeper insights."),
29
- ("Feature Engineering", "Create new features to enhance model performance."),
30
- ("Training the Model", "Use the prepared dataset to train the model."),
31
- ("Testing the Data", "Evaluate the model's performance on test data."),
32
- ("Deployment", "Deploy the model for real-world usage."),
33
- ("Monitoring", "Monitor and update the model to maintain performance."),
34
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- # Display steps as buttons in a grid layout
37
- st.markdown(
38
- """
39
- <style>
40
- .grid-container {
41
- display: grid;
42
- grid-template-columns: repeat(2, 1fr);
43
- gap: 20px;
44
- margin: 20px;
45
- }
46
- .grid-item {
47
- background-color: #f0f0f5;
48
- border: 1px solid #ddd;
49
- border-radius: 8px;
50
- padding: 20px;
51
- text-align: center;
52
- cursor: pointer;
53
- transition: all 0.3s ease;
54
- }
55
- .grid-item:hover {
56
- background-color: #e8e8f0;
57
- }
58
- </style>
59
- <div class="grid-container">
60
- """ +
61
- "".join([f'<div class="grid-item" onclick="window.location.href='#{step[0].replace(" ", "-")}';">{step[0]}</div>' for step in steps]) +
62
- "</div>"
63
- """, unsafe_allow_html=True )
64
 
65
- # Display description for the selected step
66
- selected_step = st.selectbox("Select a step to learn more:", [step[0] for step in steps])
67
- st.write(f"### {selected_step}")
68
- for step in steps:
69
- if step[0] == selected_step:
70
- st.write(step[1])
71
- break
72
 
73
- # Navigation for detailed pages
74
- if selected_step == "Data Collection" and st.button("Learn More About Data Collection"):
75
  navigate_to("data_collection")
76
-
77
- elif st.session_state.page == "data_collection":
78
- st.title("Data Collection")
79
- st.write("Here you can provide detailed content about data collection methods.")
80
- if st.button("Back to Main Page"):
81
- navigate_to("main")
82
-
 
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")