Spaces:
Sleeping
Sleeping
Update pages/3Life Cycle of Machine Learning Project.py
Browse files46 unmodified lines474849505152535455565758596061626364656667686970717273747576777879808182838485868788899046 unmodified linesimport streamlit as stfrom streamlit.components.v1 import html# Function to create a vertical step with custom colors and navigationdef vertical_step(label, link, color):step_html = f"""<div style="width: 300px; margin: 20px auto; text-align: center;"><a href="{link}" style="display: inline-block;background-color: {color};color: white;padding: 15px 20px;text-decoration: none;font-size: 16px;border-radius: 5px;font-weight: bold;box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);">{label}</a><div style="margin: 10px auto;"><span style="font-size: 20px; color: green;">✓</span></div></div>"""html(step_html)# Titlest.title("Machine Learning Workflow")st.write("Click on a step to navigate to its details.")# Steps with navigationvertical_step("Problem Statement", "?page=1", "#4A90E2")vertical_step("Data Collection", "?page=2", "#F25C54")vertical_step("Simple EDA", "?page=3", "#F7C948")vertical_step("Data Pre-processing", "?page=4", "#00B159")vertical_step("EDA", "?page=5", "#D76AC3")vertical_step("Feature Engineering", "?page=6", "#6A4C93")vertical_step("Model Building", "?page=7", "#F25C54")vertical_step("Evaluation", "?page=8", "#4A90E2")vertical_step("Deployment", "?page=9", "#00B159")vertical_step("Monitoring", "?page=10", "#D76AC3")46 unmodified lines474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911046 unmodified linesimport streamlit as st# Set up the query parameters for redirectionquery_params = st.experimental_get_query_params()# Function to display a step with a button and arrowdef display_step(label, step_number, color, is_last=False):# Button for the stepif st.button(label, key=f"step_{step_number}"):st.experimental_set_query_params(page=f"step{step_number}")# Arrow between stepsif not is_last:st.markdown("""<div style="text-align: center; margin: -10px;"><span style="font-size: 30px; color: green;">⬇️</span></div>""",unsafe_allow_html=True,)# Main Layoutst.title("Machine Learning Workflow")st.write("Click a step to navigate to its page.")# Display Stepsdisplay_step("Problem Statement", 1, "#4A90E2")display_step("Data Collection", 2, "#F25C54")display_step("Simple EDA", 3, "#F7C948")display_step("Data Pre-processing", 4, "#00B159")display_step("EDA", 5, "#D76AC3")display_step("Feature Engineering", 6, "#6A4C93")display_step("Model Building", 7, "#F25C54")display_step("Evaluation", 8, "#4A90E2")display_step("Deployment", 9, "#00B159")display_step("Monitoring", 10, "#D76AC3")# Redirect to a specific step pageif "page" in query_params:page = query_params["page"][0]st.write(f"Redirecting to {page} page...")if page == "step1":st.write("This is the **Problem Statement** page.")elif page == "step2":st.write("This is the **Data Collection** page.")elif page == "step3":st.write("This is the **Simple EDA** page.")elif page == "step4":st.write("This is the **Data Pre-processing** page.")elif page == "step5":st.write("This is the **EDA** page.")elif page == "step6":st.write("This is the **Feature Engineering** page.")elif page == "step7":st.write("This is the **Model Building** page.")elif page == "step8":st.write("This is the **Evaluation** page.")elif page == "step9":st.write("This is the **Deployment** page.")elif page == "step10":st.write("This is the **Monitoring** page.")
pages/3Life Cycle of Machine Learning Project.py+57-37