Spaces:
Sleeping
Sleeping
Update pages/Life cycle of ML.py
Browse files- pages/Life cycle of ML.py +81 -0
pages/Life cycle of ML.py
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
def home_page():
|
| 4 |
+
st.title("Machine Learning Lifecycle")
|
| 5 |
+
st.write("Explore the stages of a Machine Learning Project Lifecycle.")
|
| 6 |
+
|
| 7 |
+
# Buttons for navigation
|
| 8 |
+
if st.button("1. Problem Definition"):
|
| 9 |
+
st.experimental_set_query_params(page="problem_definition")
|
| 10 |
+
if st.button("2. Data Collection"):
|
| 11 |
+
st.experimental_set_query_params(page="data_collection")
|
| 12 |
+
if st.button("3. Data Preparation"):
|
| 13 |
+
st.experimental_set_query_params(page="data_preparation")
|
| 14 |
+
if st.button("4. Modeling"):
|
| 15 |
+
st.experimental_set_query_params(page="modeling")
|
| 16 |
+
if st.button("5. Evaluation"):
|
| 17 |
+
st.experimental_set_query_params(page="evaluation")
|
| 18 |
+
if st.button("6. Deployment"):
|
| 19 |
+
st.experimental_set_query_params(page="deployment")
|
| 20 |
+
|
| 21 |
+
st.image("https://via.placeholder.com/800x400?text=ML+Lifecycle", caption="Visual Representation of the ML Lifecycle")
|
| 22 |
+
|
| 23 |
+
def problem_definition_page():
|
| 24 |
+
st.title("1. Problem Definition")
|
| 25 |
+
st.write("Define the problem you are solving with your machine learning model.")
|
| 26 |
+
st.info("Key Questions: What is the goal? What are the metrics?")
|
| 27 |
+
st.button("Back to Home", on_click=lambda: st.experimental_set_query_params(page="home"))
|
| 28 |
+
|
| 29 |
+
def data_collection_page():
|
| 30 |
+
st.title("2. Data Collection")
|
| 31 |
+
st.write("Gather data relevant to the problem.")
|
| 32 |
+
st.info("Focus: Data quality, diversity, and sources.")
|
| 33 |
+
st.button("Back to Home", on_click=lambda: st.experimental_set_query_params(page="home"))
|
| 34 |
+
|
| 35 |
+
def data_preparation_page():
|
| 36 |
+
st.title("3. Data Preparation")
|
| 37 |
+
st.write("Clean and preprocess the data for analysis.")
|
| 38 |
+
st.info("Focus: Missing values, normalization, and splitting.")
|
| 39 |
+
st.button("Back to Home", on_click=lambda: st.experimental_set_query_params(page="home"))
|
| 40 |
+
|
| 41 |
+
def modeling_page():
|
| 42 |
+
st.title("4. Modeling")
|
| 43 |
+
st.write("Train and tune machine learning models.")
|
| 44 |
+
st.info("Focus: Algorithms, hyperparameters, and feature selection.")
|
| 45 |
+
st.button("Back to Home", on_click=lambda: st.experimental_set_query_params(page="home"))
|
| 46 |
+
|
| 47 |
+
def evaluation_page():
|
| 48 |
+
st.title("5. Evaluation")
|
| 49 |
+
st.write("Evaluate model performance using metrics.")
|
| 50 |
+
st.info("Key Metrics: Accuracy, precision, recall, F1-score, etc.")
|
| 51 |
+
st.button("Back to Home", on_click=lambda: st.experimental_set_query_params(page="home"))
|
| 52 |
+
|
| 53 |
+
def deployment_page():
|
| 54 |
+
st.title("6. Deployment")
|
| 55 |
+
st.write("Deploy the model to production for real-world use.")
|
| 56 |
+
st.info("Methods: APIs, dashboards, and live systems.")
|
| 57 |
+
st.button("Back to Home", on_click=lambda: st.experimental_set_query_params(page="home"))
|
| 58 |
+
|
| 59 |
+
def main():
|
| 60 |
+
query_params = st.experimental_get_query_params()
|
| 61 |
+
page = query_params.get("page", ["home"])[0]
|
| 62 |
+
|
| 63 |
+
if page == "home":
|
| 64 |
+
home_page()
|
| 65 |
+
elif page == "problem_definition":
|
| 66 |
+
problem_definition_page()
|
| 67 |
+
elif page == "data_collection":
|
| 68 |
+
data_collection_page()
|
| 69 |
+
elif page == "data_preparation":
|
| 70 |
+
data_preparation_page()
|
| 71 |
+
elif page == "modeling":
|
| 72 |
+
modeling_page()
|
| 73 |
+
elif page == "evaluation":
|
| 74 |
+
evaluation_page()
|
| 75 |
+
elif page == "deployment":
|
| 76 |
+
deployment_page()
|
| 77 |
+
else:
|
| 78 |
+
st.error("Page not found!")
|
| 79 |
+
|
| 80 |
+
if __name__ == "__main__":
|
| 81 |
+
main()
|