diff --git a/p2/quest/biber_pca_affil.png b/p2/quest/biber_pca_affil.png new file mode 100644 index 0000000..4a553dd Binary files /dev/null and b/p2/quest/biber_pca_affil.png differ diff --git a/p2/quest/neurobiber-pca.log b/p2/quest/neurobiber-pca.log index 7bfae6c..ccddd4c 100644 --- a/p2/quest/neurobiber-pca.log +++ b/p2/quest/neurobiber-pca.log @@ -1,5 +1,5 @@ -starting the job at: Tue Sep 2 15:53:08 CDT 2025 +starting the job at: Tue Sep 2 16:02:22 CDT 2025 setting up the environment running the neurobiber labeling script job finished, cleaning up -job pau at: Tue Sep 2 15:53:21 CDT 2025 +job pau at: Tue Sep 2 16:02:32 CDT 2025 diff --git a/p2/quest/python_scripts/neurobiber_PCA.py b/p2/quest/python_scripts/neurobiber_PCA.py index 06cde33..57cc2c7 100644 --- a/p2/quest/python_scripts/neurobiber_PCA.py +++ b/p2/quest/python_scripts/neurobiber_PCA.py @@ -5,6 +5,7 @@ import pandas as pd import numpy as np import pandas as pd import matplotlib.pyplot as plt +import seaborn as sns def format_df_data(df): @@ -33,3 +34,20 @@ if __name__ == "__main__": plt.colorbar() plt.savefig("090225_biber_pca_plot.png", dpi=300) + + plot_df = pd.DataFrame({ + "PC1": biber_vecs_pca[:, 0], + "PC2": biber_vecs_pca[:, 1], + "AuthorWMFAffil": biber_vec_df["AuthorWMFAffil"].astype(str) + }) + plt.figure(figsize=(8,6)) + sns.scatterplot( + data=plot_df, x="PC1", y="PC2", hue="AuthorWMFAffil", + palette="tab10", s=40, alpha=0.7, edgecolor=None + ) + plt.xlabel('component 1') + plt.ylabel('component 2') + plt.legend(title='AuthorWMFAffil', bbox_to_anchor=(1.05, 1), loc=2) + plt.tight_layout() + plt.savefig("biber_pca_affil.png", dpi=300) + plt.show()