<jupyter_start><jupyter_text>Ogbn-products<jupyter_code>Sage_512 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_batchsize512.npy")
products_acc_512 = np.max(Sage_512)


Sage_random_003 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_random_ratio0.003.npy")
Sage_laplacian_003 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_laplacian_ratio0.003.npy")
Sage_degree_003 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_degree_ratio0.003.npy")
Sage_kmedoid_003 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_Kmedoid_ncluster200_PropToSdFalse_AggregateLayer2_ratio0.003.npy")
Sage_label_cluster_003 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_batch_at_scale_sample_method_kmeans_cold_startFalse_redundancy40_pretrain_ratio0.002_ratio0.0005_total_ratio0.003.npy")
Sage_AGE_003 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_AGE_ratio0.003.npy')
Sage_ANRMAB_003 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_ANRMAB_ratio0.003.npy')


products_random_acc_003 = np.max(Sage_random_003)
products_degree_acc_003 = np.max(Sage_degree_003)
products_laplacian_acc_003 = np.max(Sage_laplacian_003)
products_kmedoid_acc_003 = np.max(Sage_kmedoid_003)
products_batch_at_scale_acc_003 = np.max(Sage_label_cluster_003)
products_AGE_acc_003 = np.max(Sage_AGE_003)
products_ANRMAB_acc_003 = np.max(Sage_ANRMAB_003)


Sage_random_005 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_random_ratio0.005.npy")
Sage_laplacian_005 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_laplacian_ratio0.005.npy")
Sage_degree_005 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_degree_ratio0.005.npy")
Sage_kmedoid_005 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_Kmedoid_ncluster200_PropToSdFalse_AggregateLayer2_ratio0.005.npy")
Sage_label_cluster_005 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_batch_at_scale_sample_method_kmeans_cold_startFalse_redundancy40_pretrain_ratio0.002_ratio0.0005_total_ratio0.005.npy")
Sage_AGE_005 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_AGE_ratio0.005.npy')
Sage_ANRMAB_005 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_ANRMAB_ratio0.005.npy')


products_random_acc_005 = np.max(Sage_random_005)
products_degree_acc_005 = np.max(Sage_degree_005)
products_laplacian_acc_005 = np.max(Sage_laplacian_005)
products_kmedoid_acc_005 = np.max(Sage_kmedoid_005)
products_batch_at_scale_acc_005 = np.max(Sage_label_cluster_005)
products_AGE_acc_005 = np.max(Sage_AGE_005)
products_ANRMAB_acc_005 = np.max(Sage_ANRMAB_005)



Sage_random_006 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_random_ratio0.006.npy")
Sage_laplacian_006 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_laplacian_ratio0.006.npy")
Sage_degree_006 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_degree_ratio0.006.npy")
Sage_kmedoid_006 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_Kmedoid_ncluster200_PropToSdFalse_AggregateLayer2_ratio0.006.npy")
Sage_label_cluster_006 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_batch_at_scale_sample_method_kmeans_cold_startFalse_redundancy40_pretrain_ratio0.002_ratio0.0005_total_ratio0.006.npy")
Sage_AGE_006 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_AGE_ratio0.006.npy')
Sage_ANRMAB_006 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_ANRMAB_ratio0.006.npy')


products_random_acc_006 = np.max(Sage_random_006)
products_degree_acc_006 = np.max(Sage_degree_006)
products_laplacian_acc_006 = np.max(Sage_laplacian_006)
products_kmedoid_acc_006 = np.max(Sage_kmedoid_006)
products_batch_at_scale_acc_006 = np.max(Sage_label_cluster_006)
products_AGE_acc_006 = np.max(Sage_AGE_006)
products_ANRMAB_acc_006 = np.max(Sage_ANRMAB_006)
Sage_random_008 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_random_ratio0.008.npy")
Sage_laplacian_008 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_laplacian_ratio0.008.npy")
Sage_degree_008 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_degree_ratio0.008.npy")
Sage_kmedoid_008 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_Kmedoid_ncluster200_PropToSdFalse_AggregateLayer2_ratio0.008.npy")
Sage_label_cluster_008 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_random_batch_at_scale_sample_method_kmeans_cold_startFalse_redundancy40_pretrain_ratio0.003_ratio0.0005_total_ratio0.008.npy")
Sage_AGE_008 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_AGE_ratio0.008.npy')
Sage_ANRMAB_008 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_ANRMAB_ratio0.008.npy')


products_random_acc_008 = np.max(Sage_random_008)
products_degree_acc_008 = np.max(Sage_degree_008)
products_laplacian_acc_008 = np.max(Sage_laplacian_008)
products_kmedoid_acc_008 = np.max(Sage_kmedoid_008)
products_batch_at_scale_acc_008 = np.max(Sage_label_cluster_008)
products_AGE_acc_008 = np.max(Sage_AGE_008)
products_ANRMAB_acc_008 = np.max(Sage_ANRMAB_008)


Sage_random_01 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_random_ratio0.01.npy")
Sage_laplacian_01 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_laplacian_ratio0.01.npy")
Sage_degree_01 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_degree_ratio0.01.npy")
Sage_kmedoid_01 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_Kmedoid_ncluster200_PropToSdFalse_AggregateLayer2_ratio0.01.npy")
Sage_label_cluster_01 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_batch_at_scale_sample_method_kmeans_cold_startFalse_redundancy60_pretrain_ratio0.002_ratio0.001_total_ratio0.01.npy")
Sage_AGE_01 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_AGE_ratio0.01.npy')
Sage_ANRMAB_01 = np.load('./ogbn-products/GraphSage_accuracy_list_ogbn-products_ANRMAB_ratio0.01.npy')


products_random_acc_01 = np.max(Sage_random_01)
products_degree_acc_01 = np.max(Sage_degree_01)
products_laplacian_acc_01 = np.max(Sage_laplacian_01)
products_kmedoid_acc_01 = np.max(Sage_kmedoid_01)
products_batch_at_scale_acc_01 = np.max(Sage_label_cluster_01)
products_AGE_acc_01 = np.max(Sage_AGE_01)
products_ANRMAB_acc_01 = np.max(Sage_ANRMAB_01)


Sage_label_cluster_015 = np.load("./ogbn-products/GraphSage_accuracy_list_ogbn-products_random_batch_at_scale_sample_method_kmeans_cold_startFalse_redundancy40_pretrain_ratio0.001_ratio0.0005_total_ratio0.015.npy")
products_batch_at_scale_acc_015 = np.max(Sage_label_cluster_015)
row_0 = np.array([products_acc_512, products_random_acc_003, products_degree_acc_003, products_laplacian_acc_003, 
                  products_kmedoid_acc_003, products_batch_at_scale_acc_003])

row_1 = np.array([products_acc_512, products_random_acc_005, products_degree_acc_005, products_laplacian_acc_005, 
                  products_kmedoid_acc_005, products_batch_at_scale_acc_005])

row_2 = np.array([products_acc_512, products_random_acc_008, products_degree_acc_008, products_laplacian_acc_008, 
                  products_kmedoid_acc_008, products_batch_at_scale_acc_008])

row_3 = np.array([products_acc_512, products_random_acc_01, products_degree_acc_01, products_laplacian_acc_01, 
                  products_kmedoid_acc_01, products_batch_at_scale_acc_01])
# row_3 = np.array([products_acc_512, products_random_acc_10, products_degree_acc_10, products_laplacian_acc_10, 
#                   products_kmedoid_acc_10, products_Grain_ball_acc_10, products_Grain_NND_acc_10, products_batch_at_scale_acc_10])

table = np.stack((row_0, row_1, row_2, row_3))
table = np.around(table, 3)
dataset = ["products, ratio=0.003", "products, ratio=0.005", "products, ratio=0.008", "products, ratio=0.01"]
names = ["Standard", "Random", "Degree", "Laplacian", "FeatProp", "Uncertain+Cluster"]

df = pd.DataFrame(table, columns=names, index = dataset)
df.round(3)
ratio = np.array([0.003, 0.005, 0.006, 0.008, 0.01])


Random_acc = np.array([products_random_acc_003, products_random_acc_005, products_random_acc_006, products_random_acc_008, 
                       products_random_acc_01])
Degree_acc = np.array([products_degree_acc_003, products_degree_acc_005, products_degree_acc_006, products_degree_acc_008, 
                       products_degree_acc_01])
Laplacian_acc = np.array([products_laplacian_acc_003, products_laplacian_acc_005, products_laplacian_acc_006, 
                          products_laplacian_acc_008, products_laplacian_acc_01])
FeatProp_acc = np.array([products_kmedoid_acc_003, products_kmedoid_acc_005, products_kmedoid_acc_006, 
                         products_kmedoid_acc_008, products_kmedoid_acc_01])
GIDUS_acc = np.array([products_batch_at_scale_acc_003, products_batch_at_scale_acc_005, products_batch_at_scale_acc_006, 
                      products_batch_at_scale_acc_008, products_batch_at_scale_acc_01])
AGE_acc = np.array([products_AGE_acc_003, products_AGE_acc_005, products_AGE_acc_006, products_AGE_acc_008, 
                    products_AGE_acc_01])
ANRMAB_acc = np.array([products_ANRMAB_acc_003, products_ANRMAB_acc_005, products_ANRMAB_acc_006, products_ANRMAB_acc_008, 
                       products_ANRMAB_acc_01])

index = [0, 1, 2, 3, 4]

plt.plot(ratio[index], GIDUS_acc[index], label="ScatterSample", marker = "o", markersize=5)
plt.plot(ratio[index], AGE_acc, label="AGE", marker = "o", markersize=5)
plt.plot(ratio[index], ANRMAB_acc, label="ANRMAB", marker = "o", markersize=5)
plt.plot(ratio[index], Random_acc[index], label="Random", marker = "o", markersize=5)
plt.plot(ratio[index], FeatProp_acc[index], label="FeatProp", marker = "o", markersize=5)
# p = plt.plot(ratio[index], Laplacian_acc[index], label="Laplacian", marker = "o", markersize=5)

# plt.plot([0.005, 0.01], [0.7, 0.7], color = 'black', lw=2)
plt.annotate(text='', xy=(0.005, 0.7), xytext=(0.01,0.7), arrowprops=dict(arrowstyle='<->'))
plt.plot([0.005, 0.005], [0.657, 0.7], linestyle = ':', color='black', lw=2)
plt.plot([0.01, 0.01], [0.657, 0.7], linestyle = ':', color='black', lw=2)
plt.text(0.0055, 0.69, 'save 50% labeling cost', fontsize=13)

plt.axhline(y=0.655, color='black', linestyle='--', lw=1)


plt.xlabel('Sampling Ratio', fontsize = 14)
plt.ylabel('Test Accuracy', fontsize = 14)
plt.xticks( fontsize=12)
plt.yticks(fontsize=12)
plt.legend()
plt.savefig("../Figure/products_accuracy_comparison.png")
plt.show()
fig, ax = plt.subplots(2, sharex=True, gridspec_kw={'height_ratios': [3, 1]})
ax[0].plot(ratio[index], GIDUS_acc[index], label="ScatterSample", marker = "o", markersize=5)
ax[0].plot(ratio[index], AGE_acc, label="AGE", marker = "o", markersize=5)
ax[0].plot(ratio[index], ANRMAB_acc, label="ANRMAB", marker = "o", markersize=5)
ax[0].plot(ratio[index], Random_acc[index], label="Random", marker = "o", markersize=5)
ax[0].plot(ratio[index], FeatProp_acc[index], label="FeatProp", marker = "o", markersize=5)
ax[1].plot(ratio[index], Laplacian_acc[index], label="Laplacian", marker = "o", markersize=5, color = '#8c564b')

ax[0].plot([0.005, 0.01], [0.66, 0.66], 'k-', lw=2)
ax[0].plot([0.005, 0.005], [0.657, 0.663], 'k-', lw=2)
ax[0].plot([0.01, 0.01], [0.657, 0.663], 'k-', lw=2)
ax[0].text(0.0055, 0.68, 'save 50% labeling cost', fontsize=12)


ax[0].spines['bottom'].set_visible(False)
ax[1].spines['top'].set_visible(False)
ax[1].set_xlabel('Sampling Ratio', fontsize = 14)
ax[0].set_ylabel('Test Accuracy', fontsize = 14)
ax[0].tick_params(axis='y', labelsize=12)
ax[1].tick_params(axis='x', labelsize=12)
ax[1].tick_params(axis='y', labelsize=12)

ax[0].legend()
ax[1].legend()
# fig.savefig("../Figure/products_accuracy_comparison.png")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12301721228484644, 'fraction_numerical': 0.08023962200472494, 'mean_word_length': 7.878651685393258, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '529364', 'license': 'MIT', 'n_tokens_mistral': 5436, 'n_tokens_neox': 4707, 'n_words': 447, 'path': 'save/Plot_Tables_Sage_ogbn_products.ipynb', 'repo_name': 'DAIZHENWEI/FastGCN_pytorch', 'size': '11852'}