Right now when finding the nodes we might want to put into a matrix from a semantic network, we prune the undirected version of the network using networkx to make sure concepts have a high enough degree, put those into a matrix, and prune again using SparseMatrix.squish() to make sure features have a high enough degree as well.
If we could instead represent what goes into the matrix as a bipartite undirected NetworkX graph in the first place, then we could do the pruning right the first time, and make AnalogySpace faster.
Hello.
I tried to install the module on both, Windows and Ubuntu (Python 2.7.13) and got this error: File "..\divisi2\network.py", line 114, in sparse_triples first_edge = graph.edges_iter(data=True).next() AttributeError: 'SparseMatrix' object has no attribute 'edges_iter'
np.mean() of a DenseMatrix, across one axis, should return a DenseVector of the means. Instead, it returns a DenseMatrix wrapping a vector, which is just all kinds of bad.
Fixing this will require either (a) digging into the subclass magic, or (b) making DenseMatrix and DenseVector actually the same class.
The way this bug comes about is actually pretty fascinating. But it leads to the most unhelpful possible error message.
If you try to take the SVD of a 0x0 matrix, it will notice that the matrix is at least 20% wider than tall (because 0 is 20% more than 0), and thus it will take the SVD of its transpose instead. And its transpose is also 20% wider than tall. Repeat.
I know we can build a sparse matrix from raw data as a follows: matrix = divisi2.make_sparse(entries)
Is there a way to load a pre build sparse matrix into divisi2 package.
I have a matrix built in pandas which essentially is a numpy array.