diff --git a/src/back/clustering_csv.py b/src/back/clustering_csv.py index fb93b4e..4b3b6fb 100644 --- a/src/back/clustering_csv.py +++ b/src/back/clustering_csv.py @@ -24,7 +24,7 @@ def visualize_clusters_3d(X, labels, centers=None, title="Clusters"): ax.set_xlabel("Feature 1") ax.set_ylabel("Feature 2") ax.set_zlabel("Feature 3") - plt.show() + return plt.gcf() def calculate_cluster_statistics_kmeans(X, labels, centers): unique_labels = np.unique(labels) diff --git a/src/back/managing_missing_values.py b/src/back/managing_missing_values.py index b12c463..2ecdb28 100644 --- a/src/back/managing_missing_values.py +++ b/src/back/managing_missing_values.py @@ -18,7 +18,6 @@ def drop_high_null_percentage(data, threshold=0.5): data = data.loc[:, missing_percentage <= threshold] return data - def replace_with_mean(data): return data.apply(lambda col: col.fillna(col.mean()) if col.dtype.kind in 'biufc' else col) @@ -52,7 +51,6 @@ def impute_with_regression(data): return data - """ Parameters: - data: Pandas DataFrame with the data