zero_to_hero_ML / pages /Machine learning VS Deep Learning.py
ankithpatel's picture
Update pages/Machine learning VS Deep Learning.py
fb8c713 verified
raw
history blame
2.5 kB
import streamlit as st
# CSS style for the table
css_style = """
<style>
table {
width: 100%;
border-collapse: collapse;
border: 1px solid black;
}
th {
background-color: #f2f2f2;
border: 1px solid black;
padding: 10px;
text-align: center;
}
td {
border: 1px solid black;
padding: 10px;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
tr:nth-child(odd) {
background-color: #ffffff;
}
</style>
"""
# HTML code for the differences table
html_code = """
<table>
<tr>
<th>S.no</th>
<th>Aspect</th>
<th>Machine Learning (ML)πŸ“πŸ’»</th>
<th>Deep Learning (DL)πŸ“πŸ’»</th>
</tr>
<tr>
<td>1</td>
<td>Definition</td>
<td>A subset of AI focused on enabling systems to learn from data.</td>
<td>A subset of ML that uses neural networks to process data.</td>
</tr>
<tr>
<td>2</td>
<td>Data Dependency</td>
<td>Performs well on small to medium-sized datasets.</td>
<td>Requires large datasets to perform effectively.</td>
</tr>
<tr>
<td>3</td>
<td>Model Complexity</td>
<td>Uses simple algorithms like linear regression or decision trees.</td>
<td>Utilizes complex architectures like CNNs and RNNs.</td>
</tr>
<tr>
<td>4</td>
<td>Computation Power</td>
<td>Less computationally intensive.</td>
<td>Highly computationally intensive, often requires GPUs.</td>
</tr>
<tr>
<td>5</td>
<td>Feature Engineering</td>
<td>Feature engineering is essential for performance.</td>
<td>Automatically learns features from data.</td>
</tr>
<tr>
<td>6</td>
<td>Applications</td>
<td>Fraud detection, recommendation systems, etc.</td>
<td>Image recognition, natural language processing, etc.</td>
</tr>
<tr>
<td>7</td>
<td> Training Time taken</td>
<td>Typically faster to train due to simpler algorithms</td>
<td> Takes longer to train due to the complexity of models and data size.</td>
</tr>
<tr>
<td>8</td>
<td> Interpretability</td>
<td> Easier to interpret and debug.</td>
<td> Acts as a "black box," making it harder to interpret results.</td>
</tr>
</table>
"""
# Inject CSS into Streamlit
st.markdown(css_style, unsafe_allow_html=True)
# Render the HTML in Streamlit
st.markdown(html_code, unsafe_allow_html=True)