-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
81 lines (53 loc) · 2.15 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import streamlit as st
from imports import *
# Page configuration
st.set_page_config(page_title="ML App", layout="wide")
# Sidebar navigation
st.sidebar.title("Navigation")
selected_task = st.sidebar.radio("Select a Task", ["Home", "Classification", "Clustering", "Regression","Dimensionality Reduction"])
if selected_task == "Home":
st.title("Machine Learning with scikit-learn")
st.write("Select a task from the sidebar.")
#########################
# Classification task ##
#########################
elif selected_task == "Classification":
from pages.classification import random_forest, svm, knn, naive_bayes, logistic_regression
st.subheader("Choose a Classification task to proceed: ")
# Select Classifier
selected_model = st.radio("Select a Model", ["Random Forest", "SVM", "KNN", "Naive Bayes", "Logistic Regression"])
if selected_model == "Random Forest":
random_forest.run()
if selected_model == "KNN":
knn.run()
if selected_model == "Naive Bayes":
naive_bayes.run()
if selected_model == "SVM":
svm.run()
if selected_model == "Logistic Regression":
logistic_regression.run()
#####################
# Clustering task ##
#####################
elif selected_task == "Clustering":
from pages.clustering import kmeans,agglomerative
st.subheader("Choose a Clustering task to proceed: ")
# Select Clustering method
selected_model = st.radio("Select a Model", ["K Means", "DBSCAN", "Agglomerative Clustering", "Gaussian Mixtures"])
if selected_model == "K Means":
kmeans.run()
if selected_model == "Agglomerative Clustering":
agglomerative.run()
#####################
# Regression task ##
#####################
elif selected_task == "Regression":
from pages import regression
regression.run()
elif selected_task == "Dimensionality Reduction":
from pages.dimensionality_reduction import pca
st.subheader("Choose a Dimensionality Reduction task to proceed: ")
# Select task
selected_model = st.radio("Select a Model", ["Principal Component Analysis"])
if selected_model == "Principal Component Analysis":
pca.run()