<jupyter_start><jupyter_text>Before Attack<jupyter_code>model_before = Deepwalk(adj, labels)
model_before.build()
model_before.train(idx_train)
accuracy = model_before.test(idx_test)
print(f'Test accuracy {accuracy:.2%}')<jupyter_output>Test accuracy 69.31%<jupyter_text>After Attack<jupyter_code>model_after = Deepwalk(attacker.A, labels)
model_after.build()
model_after.train(idx_train)
accuracy = model_after.test(idx_test)
print(f'Test accuracy {accuracy:.2%}')<jupyter_output>Test accuracy 65.52%<jupyter_text>Visulation<jupyter_code>def plot(embeddings, name):
    from sklearn.manifold import TSNE
    X_embedded = TSNE(n_components=2).fit_transform(embeddings)    
    
    with plt.style.context(['science', 'no-latex']):
        plt.scatter(X_embedded[:,0], X_embedded[:,1], c=labels, cmap=plt.cm.Spectral)
        plt.autoscale(tight=True)
        plt.title(name)
        plt.show()    
plot(model_before.embeddings, name="Before Attack")
plot(model_after.embeddings, name="After Attack")<jupyter_output>findfont: Font family ['serif'] not found. Falling back to DejaVu Sans.
findfont: Font family ['serif'] not found. Falling back to DejaVu Sans.
{'fraction_non_alphanumeric': 0.13126079447322972, 'fraction_numerical': 0.011226252158894647, 'mean_word_length': 6.24375, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '111594', 'license': 'MIT', 'n_tokens_mistral': 437, 'n_tokens_neox': 413, 'n_words': 70, 'path': 'examples/Untargeted Attack/test_Degree.ipynb', 'repo_name': 'EdisonLeeeee/graphadv', 'size': '1158'}