We should first identify if this behavior comes from the C++ layer or the Python layer (which also includes a scipy adaptation step)
Interestingly explicittype and matrix ordering information play an important role. Ideally extra tests and subsequent adaptations should be pushed to the Python-layer side so that no additional tricks would be needed on the user side.
Anyway the following sequence of fragments seem to work for the purpose of sketching sparse matrices (graphs) in Python, sample output also included:
import networkx as nx
from skylark import sketch
import numpy as np
import El
import scipy.sparse as sparse
num_nodes = 10000
num_attach_edges = 5
sketch_size = 10
graph = nx.random_graphs.barabasi_albert_graph(num_nodes, num_attach_edges)
Reported by @gidiko:
Using the following snippet in python:
gives
We should first identify if this behavior comes from the C++ layer or the Python layer (which also includes a scipy adaptation step)
Interestingly explicit type and matrix ordering information play an important role. Ideally extra tests and subsequent adaptations should be pushed to the Python-layer side so that no additional tricks would be needed on the user side.
Anyway the following sequence of fragments seem to work for the purpose of sketching sparse matrices (graphs) in Python, sample output also included:
And then switching to CWT(?):