Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# --- Page Config ---
|
| 4 |
+
st.set_page_config(page_title="AI Classifier and Clustering Explorer", page_icon="π€", layout="wide")
|
| 5 |
+
|
| 6 |
+
# --- Project Info Section ---
|
| 7 |
+
st.markdown(
|
| 8 |
+
"""
|
| 9 |
+
<div style="text-align: center;">
|
| 10 |
+
<h1 style="color: #4CAF50;">π AI Classifier and Clustering Explorer π</h1>
|
| 11 |
+
<h3 style="color: #555;">Explore ML Algorithms Visually & Analyze Performance</h3>
|
| 12 |
+
<p style="font-size: 18px;"><b>Project Description:</b> This project visualizes different machine learning models and their performance on classification and clustering tasks using various datasets.</p>
|
| 13 |
+
<p style="font-size: 18px;"><b>Team Members:</b> Zuhair Khan, Quaid Khalid, Anjaleen Swamni, Jay</p>
|
| 14 |
+
</div>
|
| 15 |
+
""",
|
| 16 |
+
unsafe_allow_html=True
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
st.markdown("---")
|
| 20 |
+
|
| 21 |
+
# --- Sidebar Buttons ---
|
| 22 |
+
st.sidebar.title("π Choose a Task")
|
| 23 |
+
|
| 24 |
+
st.sidebar.markdown("## π Classifiers")
|
| 25 |
+
knn_clicked = st.sidebar.button("π΅ KNN: Diagram & Prediction")
|
| 26 |
+
naive_bayes_clicked = st.sidebar.button("π’ Naive Bayes: Prediction")
|
| 27 |
+
random_forest_clicked = st.sidebar.button("π Random Forest: Prediction")
|
| 28 |
+
|
| 29 |
+
st.sidebar.markdown("## π¨ Clustering")
|
| 30 |
+
kmeans_clicked = st.sidebar.button("π΄ K-Means: Visualization")
|
| 31 |
+
|
| 32 |
+
st.sidebar.markdown("## π Comparison")
|
| 33 |
+
comparison_clicked = st.sidebar.button("π Compare All Models")
|
| 34 |
+
|
| 35 |
+
# --- Main Area Display based on Button Click ---
|
| 36 |
+
if knn_clicked:
|
| 37 |
+
st.header("π΅ K-Nearest Neighbors (KNN)")
|
| 38 |
+
st.write("You selected KNN. Running KNN visualization and prediction...")
|
| 39 |
+
# π₯ Call your KNN function here
|
| 40 |
+
# your_knn_function()
|
| 41 |
+
|
| 42 |
+
if naive_bayes_clicked:
|
| 43 |
+
st.header("π’ Naive Bayes Classifier")
|
| 44 |
+
st.write("You selected Naive Bayes. Running prediction...")
|
| 45 |
+
# π₯ Call your Naive Bayes function here
|
| 46 |
+
# your_naive_bayes_function()
|
| 47 |
+
|
| 48 |
+
if random_forest_clicked:
|
| 49 |
+
st.header("π Random Forest Classifier")
|
| 50 |
+
st.write("You selected Random Forest. Running prediction...")
|
| 51 |
+
# π₯ Call your Random Forest function here
|
| 52 |
+
# your_random_forest_function()
|
| 53 |
+
|
| 54 |
+
if kmeans_clicked:
|
| 55 |
+
st.header("π΄ K-Means Clustering")
|
| 56 |
+
st.write("You selected K-Means Clustering. Running visualization...")
|
| 57 |
+
# π₯ Call your KMeans function here
|
| 58 |
+
# your_kmeans_function()
|
| 59 |
+
|
| 60 |
+
if comparison_clicked:
|
| 61 |
+
st.header("π Model Performance Comparison")
|
| 62 |
+
st.write("Comparing performance of all models...")
|
| 63 |
+
# π₯ Call your comparison function here
|
| 64 |
+
# your_performance_comparison_function()
|
| 65 |
+
|
| 66 |
+
# --- Footer ---
|
| 67 |
+
st.markdown("---")
|
| 68 |
+
st.markdown(
|
| 69 |
+
"""
|
| 70 |
+
<div style="text-align: center; font-size: 16px;">
|
| 71 |
+
Made with β€οΈ by <b>Team Volund</b>
|
| 72 |
+
</div>
|
| 73 |
+
""",
|
| 74 |
+
unsafe_allow_html=True
|
| 75 |
+
)
|