yash-gupta-01 commited on
Commit
a094c6a
Β·
1 Parent(s): 5d275d4
Files changed (1) hide show
  1. pages/02_ml vs dl.py +91 -0
pages/02_ml vs dl.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_lottie import st_lottie
3
+ import requests
4
+
5
+ # Function to load Lottie animations
6
+ def load_lottie_url(url: str):
7
+ response = requests.get(url)
8
+ if response.status_code != 200:
9
+ return None
10
+ return response.json()
11
+
12
+ # Load Lottie animations (you can uncomment these as per your need)
13
+ # lottie_ml = load_lottie_url("https://assets8.lottiefiles.com/packages/lf20_5eyehzdr.json")
14
+ # lottie_dl = load_lottie_url("https://assets8.lottiefiles.com/packages/lf20_vfnu1k6m.json")
15
+
16
+ # Sidebar navigation
17
+ st.sidebar.title("Navigation")
18
+ page = st.sidebar.radio("Go to:", ["Home", "ML vs DL", "Comparison Table"])
19
+
20
+ # Add Navigate button to update page
21
+ if st.sidebar.button("Navigate"):
22
+ st.session_state.page = page
23
+
24
+ # Set page to session state if not already defined
25
+ if "page" not in st.session_state:
26
+ st.session_state.page = page
27
+
28
+ # Home page
29
+ if st.session_state.page == "Home":
30
+ st.title("Understanding Machine Learning and Deep Learning")
31
+ st.markdown(
32
+ """
33
+ Welcome to the interactive guide on Machine Learning (ML) and Deep Learning (DL). This space helps you
34
+ explore the differences, capabilities, and applications of ML and DL in a structured manner.
35
+ """
36
+ )
37
+ # If lottie_ml is loaded, display it (uncomment the following line when using animations)
38
+ # if lottie_ml:
39
+ # st_lottie(lottie_ml, height=300, key="ml_home")
40
+
41
+ # ML vs DL page
42
+ elif st.session_state.page == "ML vs DL":
43
+ st.title("Difference Between Machine Learning (ML) and Deep Learning (DL)")
44
+
45
+ st.subheader("Machine Learning πŸ–₯️")
46
+ st.markdown(
47
+ """
48
+ - Uses statistics to understand patterns in data and make predictions πŸ“Š.
49
+ - Can learn with less data πŸ“‰.
50
+ - Handles structured data; unstructured data must be converted to structured form πŸ”„.
51
+ - Requires less memory πŸ§ πŸ’Ύ.
52
+ - Trains models in less time ⏱️.
53
+ - Can run efficiently on CPUs without requiring powerful hardware πŸ–₯️.
54
+ """
55
+ )
56
+
57
+ st.subheader("Deep Learning πŸ€–")
58
+ st.markdown(
59
+ """
60
+ - Uses neural networks to mimic brain-like learning and decision-making 🧠.
61
+ - Requires large amounts of data for better accuracy πŸ½οΈπŸ“Š.
62
+ - Handles both structured and unstructured data like images, text, and audio πŸ–ΌοΈπŸ“πŸŽ§.
63
+ - Requires more memory and storage πŸ§ πŸ’Ύ.
64
+ - Takes more time to train due to complex calculations ⏱️.
65
+ - Needs GPUs and advanced hardware for efficient processing πŸ–₯οΈπŸ’‘.
66
+ """
67
+ )
68
+ # If lottie_dl is loaded, display it (uncomment the following line when using animations)
69
+ # if lottie_dl:
70
+ # st_lottie(lottie_dl, height=300, key="dl_page")
71
+
72
+ # Comparison Table page
73
+ elif st.session_state.page == "Comparison Table":
74
+ st.title("Comparison Table: ML vs DL")
75
+
76
+ st.markdown(
77
+ """
78
+ | **Aspect** | **Machine Learning (ML)** | **Deep Learning (DL)** |
79
+ |-------------------------|-------------------------------------------------|-------------------------------------------------|
80
+ | **Definition** | Uses algorithms and statistics to learn from data. | Uses neural networks to mimic brain-like decision-making. |
81
+ | **Data Dependency** | Works well with smaller datasets. | Requires large datasets for better accuracy. |
82
+ | **Data Type** | Handles structured data only. | Handles both structured and unstructured data. |
83
+ | **Training Time** | Requires less time to train. | Requires more time to train. |
84
+ | **Hardware** | Can run on CPUs. | Requires GPUs and advanced hardware. |
85
+ | **Memory Requirement** | Uses less memory. | Requires more memory and storage. |
86
+ """
87
+ )
88
+
89
+ st.info(
90
+ "Did you know? Deep Learning models are inspired by the human brain, making them exceptionally powerful for tasks like image recognition and natural language processing!"
91
+ )