Update pages/2_Difference_Between_Ml_and_Dl.py

#1
by udaykiranbandi - opened
pages/2_Difference_Between_Ml_and_Dl.py CHANGED
@@ -1,103 +1,153 @@
1
  import streamlit as st
2
- import pandas as pd
3
- import numpy as np
4
- import matplotlib.pyplot as plt
5
- import random
6
- import requests
7
  st.markdown("""
8
  <style>
9
- /* Set a soft background color */
10
- body {
11
- background-color: #eef2f7;
12
- }
13
- /* Style for main title */
14
- h1 {
15
- color: #00FFFF;
16
- font-family: 'Roboto', sans-serif;
17
- font-weight: 700;
18
- text-align: center;
19
- margin-bottom: 25px;
20
- }
21
- /* Style for headers */
22
- h2 {
23
- color: #FFFACD;
24
- font-family: 'Roboto', sans-serif;
25
- font-weight: 600;
26
- margin-top: 30px;
27
- }
28
-
29
- /* Style for subheaders */
30
- h3 {
31
- color: #ba95b0;
32
- font-family: 'Roboto', sans-serif;
33
- font-weight: 500;
34
- margin-top: 20px;
35
- }
36
- .custom-subheader {
37
- color: #00FFFF;
38
- font-family: 'Roboto', sans-serif;
39
- font-weight: 600;
40
- margin-bottom: 15px;
41
- }
42
- /* Paragraph styling */
43
- p {
44
- font-family: 'Georgia', serif;
45
- line-height: 1.8;
46
- color: #FFFFFF; /* Darker text color for better visibility */
47
- margin-bottom: 20px;
48
- }
49
- /* List styling with checkmark bullets */
50
- .icon-bullet {
51
- list-style-type: none;
52
- padding-left: 20px;
53
- }
54
- .icon-bullet li {
55
- font-family: 'Georgia', serif;
56
- font-size: 1.1em;
57
- margin-bottom: 10px;
58
- color: #FFFFF0; /* Darker text color for better visibility */
59
- }
60
- .icon-bullet li::before {
61
- content: "βœ”οΈ";
62
- padding-right: 10px;
63
- color: #b3b3ff;
64
- }
65
- /* Sidebar styling */
66
- .sidebar .sidebar-content {
67
- background-color: #ffffff;
68
- border-radius: 10px;
69
- padding: 15px;
70
- }
71
- .sidebar h2 {
72
- color: #495057;
73
- }
74
  </style>
75
- """, unsafe_allow_html=True)
76
- st.title("Difference Between ML and DL")
77
- st.markdown("""Whenever machines want to adopt the learning ability 🧠.We have two tools one is **Ml** and other one is **Dl**.Let's understad the major differnce between them below..""",unsafe_allow_html=True)
78
- st.header("Machine Learning πŸ–₯️")
79
- st.markdown("""
80
- <ul class="icon-bullet">
81
- <li>Machine learning uses statistics to understand patterns in data, make predictions, and help models learn from data πŸ“Š.</li>
82
- <li>Machine learning algorithms can easily learn with the help of less data πŸ“‰.</li>
83
- <li>Machine learning algorithms can only handle structured data. To deal with unstructured data, it needs to be converted into structured data πŸ”„.</li>
84
- <li>Machine learning requires less memory πŸ§ πŸ’Ύ.</li>
85
- <li>Machine learning models can be trained in less time ⏱️.</li>
86
- <li>Machine learning can run on a CPU because it handles smaller tasks without needing powerful hardware πŸ–₯️.</li>
87
- </ul>
88
  """, unsafe_allow_html=True)
89
- st.header("Deep Learning πŸ€–")
90
 
 
91
  st.markdown("""
92
- <ul class="icon-bullet">
93
- <li>Deep Learning uses neural networks, which are brain-like systems of connected nodes that learn from data to recognize patterns and make decisions. 🧠</li>
94
- <li>Deep Learning is hungry for data because it needs a large amount of information to learn patterns and make accurate predictions. The more data it has, the better it can perform. πŸ½οΈπŸ“Š</li>
95
- <li>Deep Learning can handle all types of data, including images, text, and audio, and it can learn complex patterns from both structured and unstructured data. πŸ–ΌοΈπŸ“πŸŽ§</li>
96
- <li>Deep Learning requires more memory πŸ§ πŸ’Ύ to process complex data and models.</li>
97
- <li>Deep Learning models require more time ⏱️ because of the large amount of data and complex calculations involved.</li>
98
- <li>Deep Learning requires a GPU (Graphics Processing Unit), more RAM, and storage because it processes large amounts of data efficiently. πŸ–₯οΈπŸ’‘</li>
99
- </ul>
 
 
 
100
  """, unsafe_allow_html=True)
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
 
 
 
 
 
 
1
  import streamlit as st
2
+
3
+ # Title and Introduction
 
 
 
4
  st.markdown("""
5
  <style>
6
+ body {
7
+ font-family: Arial, sans-serif;
8
+ margin: 20px;
9
+ }
10
+ .title {
11
+ text-align: center;
12
+ color: #2c3e50;
13
+ font-size: 40px;
14
+ font-weight: bold;
15
+ }
16
+ .subtitle {
17
+ text-align: center;
18
+ color: #7f8c8d;
19
+ font-size: 18px;
20
+ }
21
+ .section {
22
+ background-color: #ecf0f1;
23
+ padding: 20px;
24
+ border-radius: 10px;
25
+ margin-bottom: 20px;
26
+ box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
27
+ }
28
+ .section-header {
29
+ color: #34495e;
30
+ font-size: 24px;
31
+ margin-bottom: 10px;
32
+ text-decoration: underline;
33
+ }
34
+ ul {
35
+ list-style-type: none;
36
+ padding: 0;
37
+ }
38
+ ul li {
39
+ background-color: #ffffff;
40
+ margin: 10px 0;
41
+ padding: 15px;
42
+ border: 1px solid #dcdcdc;
43
+ border-radius: 8px;
44
+ font-size: 16px;
45
+ }
46
+ table {
47
+ width: 100%;
48
+ border-collapse: collapse;
49
+ margin-top: 20px;
50
+ }
51
+ th, td {
52
+ text-align: left;
53
+ padding: 12px;
54
+ border: 1px solid #ddd;
55
+ }
56
+ th {
57
+ background-color: #34495e;
58
+ color: white;
59
+ }
60
+ tr:nth-child(even) {
61
+ background-color: #f9f9f9;
62
+ }
63
+ tr:hover {
64
+ background-color: #f1f1f1;
65
+ }
 
 
 
 
 
66
  </style>
67
+ <div class="title">Difference Between Machine Learning (ML) and Deep Learning (DL)</div>
68
+ <p class="subtitle">Learn how ML and DL differ in capabilities, requirements, and use cases!</p>
 
 
 
 
 
 
 
 
 
 
 
69
  """, unsafe_allow_html=True)
 
70
 
71
+ # Machine Learning Section
72
  st.markdown("""
73
+ <div class="section">
74
+ <div class="section-header">Machine Learning πŸ–₯️</div>
75
+ <ul>
76
+ <li>Uses statistics to understand patterns in data and make predictions πŸ“Š.</li>
77
+ <li>Can learn with less data πŸ“‰.</li>
78
+ <li>Handles structured data; unstructured data must be converted to structured form πŸ”„.</li>
79
+ <li>Requires less memory πŸ§ πŸ’Ύ.</li>
80
+ <li>Trains models in less time ⏱️.</li>
81
+ <li>Can run efficiently on CPUs without requiring powerful hardware πŸ–₯️.</li>
82
+ </ul>
83
+ </div>
84
  """, unsafe_allow_html=True)
85
 
86
+ # Deep Learning Section
87
+ st.markdown("""
88
+ <div class="section">
89
+ <div class="section-header">Deep Learning πŸ€–</div>
90
+ <ul>
91
+ <li>Uses neural networks to mimic brain-like learning and decision-making 🧠.</li>
92
+ <li>Requires large amounts of data for better accuracy πŸ½οΈπŸ“Š.</li>
93
+ <li>Handles both structured and unstructured data like images, text, and audio πŸ–ΌοΈπŸ“πŸŽ§.</li>
94
+ <li>Requires more memory and storage πŸ§ πŸ’Ύ.</li>
95
+ <li>Takes more time to train due to complex calculations ⏱️.</li>
96
+ <li>Needs GPUs and advanced hardware for efficient processing πŸ–₯οΈπŸ’‘.</li>
97
+ </ul>
98
+ </div>
99
+ """, unsafe_allow_html=True)
100
 
101
+ # Tabular Comparison
102
+ st.markdown("""
103
+ <div class="section">
104
+ <div class="section-header">Comparison Table</div>
105
+ <table>
106
+ <thead>
107
+ <tr>
108
+ <th>Aspect</th>
109
+ <th>Machine Learning (ML)</th>
110
+ <th>Deep Learning (DL)</th>
111
+ </tr>
112
+ </thead>
113
+ <tbody>
114
+ <tr>
115
+ <td>Definition</td>
116
+ <td>Uses algorithms and statistics to learn from data.</td>
117
+ <td>Uses neural networks to mimic brain-like decision-making.</td>
118
+ </tr>
119
+ <tr>
120
+ <td>Data Dependency</td>
121
+ <td>Works well with smaller datasets.</td>
122
+ <td>Requires large datasets for better accuracy.</td>
123
+ </tr>
124
+ <tr>
125
+ <td>Data Type</td>
126
+ <td>Handles structured data only.</td>
127
+ <td>Handles both structured and unstructured data.</td>
128
+ </tr>
129
+ <tr>
130
+ <td>Training Time</td>
131
+ <td>Requires less time to train.</td>
132
+ <td>Requires more time to train.</td>
133
+ </tr>
134
+ <tr>
135
+ <td>Hardware</td>
136
+ <td>Can run on CPUs.</td>
137
+ <td>Requires GPUs and advanced hardware.</td>
138
+ </tr>
139
+ <tr>
140
+ <td>Memory Requirement</td>
141
+ <td>Uses less memory.</td>
142
+ <td>Requires more memory and storage.</td>
143
+ </tr>
144
+ </tbody>
145
+ </table>
146
+ </div>
147
+ """, unsafe_allow_html=True)
148
 
149
+ # Footer
150
+ st.markdown("""
151
+ <hr>
152
+ <p style="text-align: center; color: #7f8c8d; font-size: 14px;">Created with ❀️ using Streamlit</p>
153
+ """, unsafe_allow_html=True)