Code Monkey home page Code Monkey logo

linkstreamprediction's Introduction

Link Stream Prediction

Activity prediction in link streams algorithm

Getting Started

Prerequisites

Python3
Numpy
Scipy
Matplotlib

Default settings

Prediction with and without classes

3 classes by pair activity:

  C0: without classes
  C1: pair without interaction during observation
  C2: less than classthreshold=5 links during observation
  C3: more than classthreshold=5 links during observation
  AllClasses: Union of C1, C2 and C3
  • Activity extrapolation during training: Activity during training prediction period
  • Activity extrapolation during real prediction: Extrapolation of observation period activity
  • Gradient descent initiation: Random exploration of the parameters space between the parameters indicated in the configuration file for each metric

Data structure

Undirected link stream, sequence of triplet:

t u v
...

<float:t> : time of the link

<int:u>,<int:v> : pair of nodes

Running the prediction

cat <data_file>  | python main.py <config_file>

Configuration file structure:

<float:tstartobsT> #start time of observation training period
<float:tendobsT> #end time of observation training period
<float:tstartpredT> #start time of prediction training period
<float:tendpredT> #end time of prediction training period
<float:tstartobs> #start time of observation
<float:tendobs> #end time of observation
<float:tendpred> #end time of pred
Metrics #Metrics used:
Metric1 [parameters]
Metric2 [parameters]
Metric3 [parameters]
EndMetrics
[Options]
Commentaries:
Bla bla

Metrics available:

PairActivityExtrapolation
commonNeighbors
weightedCommonNeighbors
resourceAlloc
weightedResourceAlloc
adamicAdar
weightedAdamicAdar
sorensenIndex
weightedSorensenIndex
PairActivityExtrapolationNbLinks<int:k>
PairActivityExtrapolationTimeInter<float:k>

parameters: ,

Output:

By default the algorithm output the prediction quality and the metric combination used by during the prediction by classes.

The list of predicted activities can be extracted via the "Extract" option (see below)

Other settings:

  • Prediction extraction (In configuration file : [Option] = Extract <directory>). Example and format in folder TestExtract
  • Classes by UPGMA, cut by inverse order of agregation (In configuration file : [Option] = UPGMAINV int:nbCluster float:VandPparameter)
  • Classes par UPGMA, cut by size (In configuration file : [Option] = UPGMASIZE int:nbCluster float:VandPparameter)
  • One step prediction using the the parameters indicated in the configuration file for each metric (In config file : [Option] = Onepred)

linkstreamprediction's People

Contributors

thibauda avatar

Watchers

 avatar  avatar

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.