(X_scaled, algorithm, n_clusters)
| 357 | return pd.DataFrame() |
| 358 | |
| 359 | def apply_clustering(X_scaled, algorithm, n_clusters): |
| 360 | if algorithm == "K-Means": |
| 361 | clusterer = KMeans(n_clusters=n_clusters, random_state=42, n_init=10) |
| 362 | elif algorithm == "Hierarchical": |
| 363 | clusterer = AgglomerativeClustering(n_clusters=n_clusters, linkage='ward') |
| 364 | else: |
| 365 | clusterer = DBSCAN(eps=0.5, min_samples=2) |
| 366 | |
| 367 | cluster_labels = clusterer.fit_predict(X_scaled) |
| 368 | return cluster_labels.astype(str) |
| 369 | |
| 370 | def gen_real_pred_errors(df, test_periods=6): |
| 371 | errors = [] |
nothing calls this directly
no outgoing calls
no test coverage detected