项目作者: ThibaudA

项目描述 :
链路流预测 - 链路流算法中的活动预测
高级语言: Python
项目地址: git://github.com/ThibaudA/linkstreamprediction.git
创建时间: 2017-12-24T11:42:55Z
项目社区:https://github.com/ThibaudA/linkstreamprediction

开源协议:

下载


Link Stream Prediction

Activity prediction in link streams algorithm

Getting Started

Prerequisites

  1. Python3
  2. Numpy
  3. Scipy
  4. Matplotlib

Default settings

Prediction with and without classes

3 classes by pair activity:

  1. C0: without classes
  2. C1: pair without interaction during observation
  3. C2: less than classthreshold=5 links during observation
  4. C3: more than classthreshold=5 links during observation
  5. 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:

  1. t u v
  2. ...

\ : time of the link

\,\ : pair of nodes

Running the prediction

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

Configuration file structure:

  1. <float:tstartobsT> #start time of observation training period
  2. <float:tendobsT> #end time of observation training period
  3. <float:tstartpredT> #start time of prediction training period
  4. <float:tendpredT> #end time of prediction training period
  5. <float:tstartobs> #start time of observation
  6. <float:tendobs> #end time of observation
  7. <float:tendpred> #end time of pred
  8. Metrics #Metrics used:
  9. Metric1 [parameters]
  10. Metric2 [parameters]
  11. Metric3 [parameters]
  12. EndMetrics
  13. [Options]
  14. Commentaries:
  15. Bla bla

Metrics available:

  1. PairActivityExtrapolation
  2. commonNeighbors
  3. weightedCommonNeighbors
  4. resourceAlloc
  5. weightedResourceAlloc
  6. adamicAdar
  7. weightedAdamicAdar
  8. sorensenIndex
  9. weightedSorensenIndex
  10. PairActivityExtrapolationNbLinks<int:k>
  11. 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 \). Example and format in folder TestExtract
  • Classes by UPGMA, cut by inverse order of agregation (In configuration file : [Option] = UPGMAINV )
  • Classes par UPGMA, cut by size (In configuration file : [Option] = UPGMASIZE )
  • One step prediction using the the parameters indicated in the configuration file for each metric (In config file : [Option] = Onepred)