|
367 | 367 | "def plot_feature_correlation_matrix(features: pd.DataFrame) -> None:\n", |
368 | 368 | " \"\"\"\n", |
369 | 369 | " Plots the correlation matrix of the features in the DataFrame.\n", |
370 | | - " \n", |
371 | | - " :param java_package_anomaly_detection_features: DataFrame containing the features.\n", |
372 | | - " :param java_package_features_to_standardize: List of feature names to include in the correlation matrix.\n", |
373 | 370 | " \"\"\"\n", |
374 | 371 | " correlation_matrix = features.corr()\n", |
375 | 372 | "\n", |
|
381 | 378 | " axis.set_xticklabels(correlation_matrix.columns, rotation=90)\n", |
382 | 379 | " axis.set_yticklabels(correlation_matrix.index)\n", |
383 | 380 | " for (i, j), correlation_value in np.ndenumerate(correlation_matrix.values):\n", |
384 | | - " axis.text(j, i, f\"{correlation_value:.2f}\", ha='center', va='center', color='black', bbox=dict(facecolor='white', alpha=0.3, edgecolor='none'))\n", |
| 381 | + " axis.text(j, i, f\"{correlation_value:.2f}\", ha='center', va='center', color='black', bbox=dict(facecolor='white', alpha=0.3, edgecolor='none'), fontsize=6)\n", |
385 | 382 | " plot.title(\"Feature Correlation Matrix (excluding embeddings)\", fontsize=10)\n", |
386 | 383 | " plot.tight_layout()\n", |
387 | 384 | " plot.show()" |
|
946 | 943 | " x_position_column: str = 'embeddingVisualizationX',\n", |
947 | 944 | " y_position_column: str = 'embeddingVisualizationY',\n", |
948 | 945 | " annotate_top_n_anomalies: int = 10,\n", |
949 | | - " annotate_top_n_non_anomalies: int = 5,\n", |
950 | | - " annotate_top_n_clusters: int = 20,\n", |
| 946 | + " annotate_top_n_non_anomalies: int = 3,\n", |
| 947 | + " annotate_top_n_clusters: int = 10,\n", |
951 | 948 | " percentile_of_distance_to_center: float = 0.8,\n", |
952 | 949 | " no_cluster_coloring: bool = False,\n", |
953 | 950 | ") -> None:\n", |
|
995 | 992 | " cluster_non_noise = cluster_without_anomalies[cluster_without_anomalies[cluster_label_column] != -1]\n", |
996 | 993 | "\n", |
997 | 994 | " plot.figure(figsize=(10, 10))\n", |
998 | | - " plot.title(f\"{title_prefix} (size={size_column}, main-color=cluster, red=anomaly, green=non-anomaly)\", pad=20)\n", |
| 995 | + " plot.title(\n", |
| 996 | + " label=f\"{title_prefix} (size={size_column}, main-color=cluster, red=anomaly, green=non-anomaly)\", \n", |
| 997 | + " pad=30,\n", |
| 998 | + " bbox=dict(facecolor='white', edgecolor='none', pad=2, alpha=0.6)\n", |
| 999 | + " )\n", |
999 | 1000 | "\n", |
1000 | 1001 | " # Plot noise (from clustering)\n", |
1001 | 1002 | " plot.scatter(\n", |
|
1111 | 1112 | " **plot_annotation_style\n", |
1112 | 1113 | " )\n", |
1113 | 1114 | "\n", |
| 1115 | + " plot.tight_layout(pad=0.2)\n", |
| 1116 | + " plot.axis('off')\n", |
1114 | 1117 | " plot.show()" |
1115 | 1118 | ] |
1116 | 1119 | }, |
|
1263 | 1266 | " **plot_annotation_style\n", |
1264 | 1267 | " )\n", |
1265 | 1268 | "\n", |
| 1269 | + " plot.tight_layout(pad=0.2)\n", |
| 1270 | + " plot.axis('off')\n", |
1266 | 1271 | " plot.show()" |
1267 | 1272 | ] |
1268 | 1273 | }, |
|
0 commit comments