Activity prediction in link streams algorithm
Python3
Numpy
Scipy
Matplotlib
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
Undirected link stream, sequence of triplet:
t u v
...
<float:t> : time of the link
<int:u>,<int:v> : pair of nodes
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: ,
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)
- 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)