plot tool updates
This commit is contained in:
@@ -78,11 +78,19 @@ def plot_tsne_latent_space(normal_data, anomaly_data, title="TSNE of Latent Spac
|
||||
Plot the TSNE representation of the latent space.
|
||||
This function first applies a PCA-based dimensionality reduction for efficiency.
|
||||
"""
|
||||
# Hardcoded variables to choose every nth normal sample and mth anomaly sample
|
||||
n = 10 # Change this value to select every nth normal sample
|
||||
m = 2 # Change this value to select every mth anomaly sample
|
||||
|
||||
# Select every nth normal sample and mth anomaly sample
|
||||
normal_data = normal_data[::n]
|
||||
anomaly_data = anomaly_data[::m]
|
||||
|
||||
# Combine normal and anomaly data
|
||||
combined_data = np.vstack((normal_data, anomaly_data))
|
||||
|
||||
# Initial dimensionality reduction with PCA
|
||||
reduced_data = reduce_dimensionality(combined_data, n_components=50)
|
||||
reduced_data = reduce_dimensionality(combined_data, n_components=100)
|
||||
|
||||
# Apply TSNE transformation on the PCA-reduced data
|
||||
tsne = TSNE(n_components=2, random_state=42)
|
||||
|
||||
Reference in New Issue
Block a user