Giter Club home page Giter Club logo

graphpca's Introduction

GraphPCA

Produces a low-dimensional representation of the input graph.

Calculates the ECTD1 of the graph and reduces its dimension using PCA. The result is an embedding of the graph nodes as vectors in a low-dimensional space.

Graph data in this repository is courtesy of the mind-blowingly cool University of Florida Sparse Matrix Collection.

Python 3.x and 2.6+.

See the API docs: https://brandones.github.io/graphpca/

Usage

Draw a graph, including edges, from a mat file :

>>> import scipy.io
>>> import networkx as nx
>>> import graphpca
>>> mat = scipy.io.loadmat('test/bcspwr01.mat')
>>> A = mat['Problem'][0][0][1].todense()  # that's just how the file came
>>> G = nx.from_numpy_array(A)
>>> graphpca.draw_graph(G)

image

Get a 2D PCA of a high-dimensional graph and plot it. :

>>> import networkx as nx
>>> import graphpca
>>> g = nx.erdos_renyi_graph(1000, 0.2)
>>> g_2 = graphpca.reduce_graph(g, 2)
>>> graphca.plot_2d(g_2)

image

Contributing

Issues and Pull requests are very welcome! [On GitHub](https://github.com/brandones/graphpca).


  1. https://www.info.ucl.ac.be/~pdupont/pdupont/pdf/ecml04.pdfโ†ฉ

graphpca's People

Contributors

brandones avatar danielwicz avatar

Forkers

danielwicz

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.