You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
838 B
23 lines
838 B
import streamlit as st
|
|
import sys
|
|
import os
|
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../backend')))
|
|
from dbscan_strategy import perform_dbscan_clustering
|
|
|
|
st.header("Clustering: DBSCAN")
|
|
|
|
if "data" in st.session_state:
|
|
data = st.session_state.data
|
|
|
|
with st.form("dbscan_form"):
|
|
data_name = st.multiselect("Data Name", data.select_dtypes(include="number").columns, max_selections=3)
|
|
eps = st.slider("eps", min_value=0.0, max_value=1.0, value=0.5, step=0.01)
|
|
min_samples = st.number_input("min_samples", step=1, min_value=1, value=5)
|
|
submitted = st.form_submit_button("Launch")
|
|
|
|
if submitted and 2 <= len(data_name) <= 3:
|
|
fig = perform_dbscan_clustering(data, data_name, eps, min_samples)
|
|
st.pyplot(fig)
|
|
else:
|
|
st.error("File not loaded")
|