Git Product home page Git Product logo

rgraphm's Introduction

#RGRAPHM

This is a C++ version of the rpgrah program. The original can be found at seeslab.net or github.com/seeslab/rgraph

Paper:

Predicting Human Preferences Using the Block Structure of Complex Social Networks

In this version, the main objective is performance. If you find any bug or something to improve, please contact me at [email protected] or open an issue in the rgraphm repository.

###USAGE

main_recommender -t trainFile -q queryFile -s randomseed -m mark -a [gibbs]

-a: Algorithm to perform the calculations. Options are "metropolis"
    or "gibbs". Default is "metropolis".

-t: Path to train file in format a b c where 'a' is the first 
    node id, 'b' is the second node id and c is the weight of their 
    link. Weight values must range from 0 to N.

-q: Path to query file in format a b where 'a' is the first 
    node id of the query and 'b' is the second node id of the query.

-s: Seed for the random. If you use the same value and number 
    of iterations, you will always obtain the same results.

-m: Number of different ratings a user can apply. For example, if a 
    node of the second set can be voted from 0 to 4 stars, mark would 
    be 5.

-n: Numer of Monte Carlo steps.

-h: Show help.

###DEPENDENCIES

  • Execution
  • libgsl0dbl
  • boost
  • Compilation
  • libgsl0-dev
  • boost-devel

###PERFORMANCE

To check performance and improve it, you can use valgrind profiler (apt-get install valgrind). Once installed, execute the application as follows:

valgrind --tool=callgrind ./main_recommender args

After execution ends, an output file is generated. You can open it directly and try to interpret it. I recommend using Kcachegrind (apt-get install kcachegrind) which provides an awesome interface to navigate through call graphs, source code (if available) and more.

NOTE: If you want to generate profiling info will valgrind, the program will last much more. You also need to compile it with debug options (-g in gcc).

  • Don't try to access gglinks.data like a 1D array, it is slower.
  • Removing the set_ind switch in calculatedH doesn't improve performance.

rgraphm's People

Contributors

argaen avatar

Watchers

 avatar  avatar

rgraphm's Issues

Free memory

Implement free functions in order to free RAM...

Node id to String

Some dataset come with hashed ids.... Change int id to str. This may results in worse performance... further testing is needed. Maybe a temporary mapping could resolve this.

Improve Thermalize and Decorrelation

With big networks this functions are very very slow... need some improvements. Number of groups that are initially created can be reduced and group the nodes according to their similarity. With this, this functions would be faster and used memory lower.

Read thermalization from file

This steps are static with the same network (more or less). Implement a function to load the network state from a file which is already thermalized.

Support multi queries

Code can only process one query since query matrix is not correctly initialized. Priority is low.

3D matrix to 1-dimensional array

Test performance with this transformation, code will become a bit messy but time may be also reduced drastically since this matrix is used a lot.

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.