Spaces:
Sleeping
Sleeping
Roberta2024
commited on
Commit
•
1f37348
1
Parent(s):
3aa3893
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,11 @@ from sklearn.decomposition import PCA
|
|
7 |
from scipy.cluster.hierarchy import fcluster
|
8 |
|
9 |
# ================== 加載保存的模型 ==================
|
10 |
-
scaler = joblib.load('
|
11 |
-
pca = joblib.load('
|
12 |
-
kmeans = joblib.load('
|
13 |
-
linked = joblib.load('
|
14 |
-
dbscan = joblib.load('
|
15 |
|
16 |
# 定義繪圖函數
|
17 |
def plot_clusters(data, labels, title):
|
|
|
7 |
from scipy.cluster.hierarchy import fcluster
|
8 |
|
9 |
# ================== 加載保存的模型 ==================
|
10 |
+
scaler = joblib.load('scaler.sav') # 標準化模型
|
11 |
+
pca = joblib.load('pca_model.sav') # PCA 模型
|
12 |
+
kmeans = joblib.load('kmeans_model.sav') # K-means 模型
|
13 |
+
linked = joblib.load('hierarchical_model.sav') # 階層式聚類模型
|
14 |
+
dbscan = joblib.load('dbscan_model.sav') # DBSCAN 模型
|
15 |
|
16 |
# 定義繪圖函數
|
17 |
def plot_clusters(data, labels, title):
|