Spaces:
Sleeping
Sleeping
first push
Browse files- src/streamlit_app.py +10 -10
src/streamlit_app.py
CHANGED
|
@@ -9,21 +9,21 @@ from sklearn.neighbors import KNeighborsClassifier
|
|
| 9 |
from sklearn.tree import DecisionTreeClassifier
|
| 10 |
from sklearn.metrics import accuracy_score, r2_score
|
| 11 |
|
| 12 |
-
# ======
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
#
|
| 19 |
for folder in [UPLOAD_DIR, PROCESSED_DIR, PKL_DIR, ENCODERS_DIR]:
|
| 20 |
os.makedirs(folder, exist_ok=True)
|
| 21 |
|
| 22 |
st.sidebar.title("Navigation")
|
| 23 |
-
page = st.sidebar.selectbox(
|
| 24 |
-
"Go to",
|
| 25 |
-
["Upload File", "Preprocess Data", "Train & Select Model", "Create App"]
|
| 26 |
-
)
|
| 27 |
|
| 28 |
# ========================
|
| 29 |
# Upload File Page
|
|
|
|
| 9 |
from sklearn.tree import DecisionTreeClassifier
|
| 10 |
from sklearn.metrics import accuracy_score, r2_score
|
| 11 |
|
| 12 |
+
# ========================
|
| 13 |
+
# Directory Setup
|
| 14 |
+
# ========================
|
| 15 |
+
BASE_DIR = "/tmp" # Writable directory in hosted environments
|
| 16 |
+
UPLOAD_DIR = os.path.join(BASE_DIR, "uploads")
|
| 17 |
+
PROCESSED_DIR = os.path.join(BASE_DIR, "processed")
|
| 18 |
+
PKL_DIR = os.path.join(BASE_DIR, "pkl")
|
| 19 |
+
ENCODERS_DIR = os.path.join(BASE_DIR, "encoders")
|
| 20 |
|
| 21 |
+
# Create directories if they don't exist
|
| 22 |
for folder in [UPLOAD_DIR, PROCESSED_DIR, PKL_DIR, ENCODERS_DIR]:
|
| 23 |
os.makedirs(folder, exist_ok=True)
|
| 24 |
|
| 25 |
st.sidebar.title("Navigation")
|
| 26 |
+
page = st.sidebar.selectbox("Go to", ["Upload File", "Preprocess Data", "Train & Select Model", "Create App"])
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
# ========================
|
| 29 |
# Upload File Page
|