question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MemoryError at algorithms.big_clam

See original GitHub issue

Describe the bug I was unable to run the algorithms.big_clam algorithm in a graph with 2436844 edges, receiving a MemoryError.

To Reproduce I’m instantiating my graph from a data frame with source, target and weight, and than trying to get the communities.

g = nx.from_pandas_edgelist(ds, ‘source’, ‘target’, ‘weight’) coms = algorithms.big_clam(g, 500)

  • CDlib version cdlib-0.1.7
  • Operating System mac os 10.12.5
  • Python version 3.6
  • Version(s) of CDlib required libraries

Additional context I’m using jupyter notebook

Exception trace

MemoryError Traceback (most recent call last) <ipython-input-123-1161752e0744> in <module> ----> 1 coms = algorithms.big_clam(g, 500)

/opt/conda/lib/python3.6/site-packages/cdlib/algorithms/overlapping_partition.py in big_clam(g, number_communities) 576 g = convert_graph_formats(g, nx.Graph) 577 –> 578 communities = BIGCLAM.big_Clam(g, number_communities) 579 580 return NodeClustering(communities, g, “BigClam”, method_parameters={“number_communities”: number_communities}, overlap=True)

/opt/conda/lib/python3.6/site-packages/cdlib/algorithms/internal/BIGCLAM.py in big_Clam(graph, number_communities) 76 77 def big_Clam(graph, number_communities): —> 78 adj = nx.to_numpy_matrix(graph) 79 F = train(adj, number_communities) 80 F_argmax = np.argmax(F, 1)

/opt/conda/lib/python3.6/site-packages/networkx/convert_matrix.py in to_numpy_matrix(G, nodelist, dtype, order, multigraph_weight, weight, nonedge) 446 return M 447 –> 448 449 def from_numpy_matrix(A, parallel_edges=False, create_using=None): 450 “”"Returns a graph from numpy matrix.

/opt/conda/lib/python3.6/site-packages/networkx/convert_matrix.py in to_numpy_array(G, nodelist, dtype, order, multigraph_weight, weight, nonedge) 1125 # This occurs when there are fewer desired nodes than 1126 # there are nodes in the graph: len(nodelist) < len(G) -> 1127 pass 1128 1129 A[np.isnan(A)] = nonedge

/opt/conda/lib/python3.6/site-packages/numpy/core/numeric.py in full(shape, fill_value, dtype, order) 300 shape : int or sequence of ints 301 Shape of the new array, e.g., (2, 3) or 2. –> 302 fill_value : scalar 303 Fill value. 304 dtype : data-type, optional

MemoryError:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
GiulioRossetticommented, Oct 11, 2019

You are right my bad, I didn’t notice the transformation dependency. I have to check but, it is likely that this implementation of bigclam does not accept sparse scipy matrices… I’ll try to figure it out next week.

0reactions
Yquetzalcommented, Feb 13, 2020

Since we identified the problem, and we added a new implemention by integrating the karate club library, I close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a memory error when using birch algorithm in python
I suppose that you are using scikit-learn. This is an issue that has been resolved here. Try updating your scikit-learn module using.
Read more >
A cross-category method comparison for doing market basket ...
A solution is to use the. BigCLAM algorithm to extract the model from the graph. ... CPM method did not work because of...
Read more >
cdlib.algorithms.big_clam - Read the Docs
BigClam is an overlapping community detection method that scales to large networks. The procedure uses gradient ascent to create an embedding which is...
Read more >
Re: MemoryError when using nx.simple_cycles on a 55 nodes ...
File "C:\Python27\lib\site-packages\networkx\algorithms\cycles.py", line 165, in circuit result.append(path + [startnode]) MemoryError >>>
Read more >
Overlapping Community Detection at Scale: A Nonnegative ...
In this paper we present BIGCLAM (Cluster Affiliation Model ... we develop a model-based community detection algorithm that can.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found