Skip to content

What does node2vec expect in .wv method? #5

@chuymtz

Description

@chuymtz

Hello,

I;m working through chapter 4. In the prediction of the test set, you use train_mask_str in the book but in your gh code you use train_mask. Depending on which one you use one gets very different results.

if you pass the integer mask you get something that won't go pass 60% accuracy.

y_pred = clf.predict(node2vec.wv[test_mask])
acc = accuracy_score(y_pred, labels[test_mask])
print(f'Node2Vec accuracy = {acc*100:.2f}%')
>>>Node2Vec accuracy = 59.09%

But if i pass the string mask i get what you report both in gh and the book . Which seems really high considering how many samples you pick out in the train and test.

y_pred = clf.predict(node2vec.wv[test_mask_str])
acc = accuracy_score(y_pred, labels[test_mask])
print(f'Node2Vec accuracy = {acc*100:.2f}%')
>>>Node2Vec accuracy = 95.45%

How can one explain this discrepancy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions