Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grape edge prediction # edges reported #50

Open
abbynewbury opened this issue Jul 14, 2023 · 1 comment
Open

Grape edge prediction # edges reported #50

abbynewbury opened this issue Jul 14, 2023 · 1 comment

Comments

@abbynewbury
Copy link

Hi!

I am using edge prediction evaluation and LogisticRegressionCVEdgePrediction for my graph, which has the following:

print(f"Number of edges in graph: {len(graph.get_edge_node_ids(directed=False))}")
Number of edges in graph: 4541
print(f"Number of nodes in graph: {len(graph.get_node_ids())}")
Number of nodes in graph: 1875.

However, when I run edge prediction evaluation:
results = edge_prediction_evaluation(
holdouts_kwargs=dict(train_size=0.8),
graphs=graph,
models=LogisticRegressionCVEdgePrediction(max_iter=500),
number_of_holdouts=1,
node_features=model
)

where model = Node2VecSkipGramEnsmallen(embedding_size=EMBEDDING_SIZE,walk_length = WALK_LENGTH,return_weight = RETURN_WEIGHT, explore_weight=EXPLORE_WEIGHT, iterations=NUM_WALKS).fit_transform(graph)

I find that the results report:
nodes_number: 1875
edges_number: 9082

I was wondering why the prediction is reporting double the number of edges than are actually present in the graph? Thanks!

@LucaCappelletti94
Copy link
Member

You are most likely predicting an undirected graph, which is a graph where interactions go in both directions. So it is providing the prediction in both directions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants