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

Error when running link prediction #95

Open
dream-hello opened this issue May 7, 2020 · 0 comments
Open

Error when running link prediction #95

dream-hello opened this issue May 7, 2020 · 0 comments

Comments

@dream-hello
Copy link

dream-hello commented May 7, 2020

Hi,Palash Goyal
When I try to run link prediction by adding the following code in my example

models.append(HOPE(d=4, beta=0.01))

for embedding in models:
    print ('Num nodes: %d, num edges: %d' % (G.number_of_nodes(), G.number_of_edges()))
    t1 = time()
    # Learn embedding - accepts a networkx graph or file with edge list
    Y, t = embedding.learn_embedding(graph=G, edge_f=None, is_weighted=True, no_python=True)
    print (embedding._method_name+':\n\tTraining time: %f' % (time() - t1))
    # MAP, prec_curv, err, err_baseline = gr.evaluateStaticGraphReconstruction(G, embedding, Y, None)
    MAP,prec_curv = lp.evaluateStaticLinkPrediction(G,embedding,0.8,is_undirected = False)

I got the error:

nx.weakly_connected_component_subgraphs(train_digraph),
AttributeError: module 'networkx' has no attribute 'weakly_connected_component_subgraphs'.

This may be the version of networkx. when I tried to use Networkx = 1.11, there will be other errors

How can I solve it?

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

1 participant