Coder Social home page Coder Social logo

commonsense / divisi2 Goto Github PK

View Code? Open in Web Editor NEW
77.0 77.0 22.0 38.19 MB

A Python library for learning from dimensionality reduction, supporting sparse and dense matrices.

Home Page: http://csc.media.mit.edu/divisi

License: GNU General Public License v3.0

C 36.16% Python 63.84%

divisi2's People

Contributors

havasi avatar kcarnold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

divisi2's Issues

divisi2.network is unnecessarily slow

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.

Class "SparseMatrix" doesn't have method "edges_iter"

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'

Could you look at it?
Thanks in advance!

Python 3?

When pip install conceptnet failed due to it supporting only Python 3, I switched to 3. Now it seems both divisi and divisi2 support only Python 2?

How do I get divisi on 3?

np.mean(DenseMatrix, axis=n) gives a malformed DenseMatrix

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.

Workaround: run np.asarray() on it first.

SVD of a 0x0 matrix leads to infinite recursion

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.

This should just give a reasonable error message.

load pre built sparse matrix

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.