Giter Site home page Giter Site logo

ivmreg / cs161sp12-linkpred Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ricefield/cs161sp12-linkpred

0.0 2.0 0.0 1.17 MB

semester project for cs161 spring 2012 - google+ link prediction

Python 29.38% Ruby 13.88% Makefile 0.69% C 14.81% C++ 41.24%

cs161sp12-linkpred's Introduction

Setup:
- install redis DB, ruby, python (we used python 2.7.2)
- for perceptron: install numpy for python
- for libSVM: go to libsvm/python and run "make" [requires g++]
- copy libsvm/ to "/usr/libsvm/"

Running the pipeline:
1. run the Redis database
>> redis-server
2. migrate the files to Redis
>> ruby redis_adapter.rb
  - currently hard-coded to work on "graph-07-04-2011" and "graph-07-11-2011", must be changed inline for other snapshots
3. run the extractor code
>> ./extractor.py "snapshot1_name" "snapshot2_name" "output_prefix" [-v]
  - note that this expects file names as strings, not the file itself. Omit the ".txt"
  - output_name is the prefix you want to give your output files. The extractor appends _[train/test]_[s/p] to distinguish between training and testing sets, and between SVM and perceptron format
  - this takes a long time, and the optional -v flag prints the number of edges extracted
4a. run the analysis code for libSVM
>> ./analyze_libsvm.py "training_filename" "test_filename" "output_filename"
  - again, this expects file names as strings, and not the file itself as an argument
  - the output files from analyze_libsvm are of the format used for libsvm here
4b. run the analysis code for perceptron
>> python perceptron_test.py
  - may require you to first go to the python-perceptron folder, as well as moving the training and testing files to the python-perceptron/data folder
5. run the evalation file
>> ./eval.py < data
  - "data" is the output file of either the perceptron or libSVM code, and here is the actual file

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.