├── .gitignore
├── README.md
├── Tutorial.ipynb
├── data
├── SMH
│ ├── SMH-cascade-0.csv
│ ├── SMH-cascade-1.csv
│ ├── SMH-cascade-10.csv
│ ├── SMH-cascade-11.csv
│ ├── SMH-cascade-12.csv
│ ├── SMH-cascade-13.csv
│ ├── SMH-cascade-14.csv
│ ├── SMH-cascade-15.csv
│ ├── SMH-cascade-16.csv
│ ├── SMH-cascade-17.csv
│ ├── SMH-cascade-18.csv
│ ├── SMH-cascade-19.csv
│ ├── SMH-cascade-2.csv
│ ├── SMH-cascade-3.csv
│ ├── SMH-cascade-4.csv
│ ├── SMH-cascade-5.csv
│ ├── SMH-cascade-6.csv
│ ├── SMH-cascade-7.csv
│ ├── SMH-cascade-8.csv
│ └── SMH-cascade-9.csv
└── hashtags-political-bias.xlsx
└── scripts
├── __init__.py
├── __pycache__
├── __init__.cpython-36.pyc
├── influence.cpython-36.pyc
└── user_influence.cpython-36.pyc
├── casIn
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-36.pyc
│ └── user_influence.cpython-36.pyc
└── user_influence.py
└── influence.py
/.gitignore:
--------------------------------------------------------------------------------
1 | .ipynb_checkpoints/
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Cascade Influence
3 |
4 | This repository contains:
5 |
6 | - The scripts to estimate user influence from Twitter information cascades (i.e. Cas.In);
7 | - A small dataset of 20 cascades for testing Cas.In;
8 | - A hands-on tutorial to walk you through running Cas.In on real cascades.
9 |
10 | ### Citation
11 | The algorithm was introduced in the paper:
12 |
13 | Rizoiu, M.-A., Graham, T., Zhang, R., Zhang, Y., Ackland, R., & Xie, L. (2018). **#DebateNight: The Role and Influence of Socialbots on Twitter During the 1st 2016 U.S. Presidential Debate**. In *Proc. International AAAI Conference on Web and Social Media (ICWSM ’18)* (pp. 1–10). Stanford, CA, USA.
14 | [pdf at arxiv with supplementary material](https://arxiv.org/abs/1802.09808)
15 |
16 | **Bibtex**
17 | ```
18 | @inproceedings{rizoiu2018debatenight,
19 | address = {Stanford, CA, USA},
20 | author = {Rizoiu, Marian-Andrei and Graham, Timothy and Zhang, Rui and Zhang, Yifei and Ackland, Robert and Xie, Lexing},
21 | booktitle = {International AAAI Conference on Web and Social Media (ICWSM '18)},
22 | title = {{{\#}DebateNight: The Role and Influence of Socialbots on Twitter During the 1st 2016 U.S. Presidential Debate}},
23 | url = {https://arxiv.org/abs/1802.09808},
24 | year = {2018}
25 | }
26 | ```
27 |
28 | ### License
29 | Both dataset and code are distributed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license, a copy of which can be obtained following this link. If you require a different license, please contact [Yifei Zhang](mailto:yifeiacc@gmail.com), [Marian-Andrei Rizoiu](mailto:Marian-Andrei@rizoiu.eu) or [Lexing Xie](mailto:Lexing.Xie@anu.edu.au).
30 |
31 | # How to run Cas.In in a terminal:
32 |
33 | ### Required packages:
34 |
35 | - python3
36 | - numpy
37 | - pandas
38 |
39 | ### Arguments of Cas.In:
40 |
41 | *--cascade_path* : the path of cascade file (see the format here below).
42 |
43 | *--time_decay* : the coefficient value of time decay (hyperparameter $r$ in the paper). **Default**:-0.000068
44 |
45 | *--save2csv* : save result to csv file. **Default**: False
46 |
47 | ### Command:
48 | ```bash
49 | cd scripts
50 | python3 influence.py --cascade_path path/to/file
51 | ```
52 |
53 | # File format and toy dataset
54 |
55 | ### Dataset
56 | We provide a toy dataset -- dubbed SMH -- for testing Cas.In.
57 | It was collected in 2017 by following the Twitter handle of the Sydney Morning Herald newspaper (tweets and retweets mentioning SMH or linking to an article from SMH).
58 |
59 | The data contains 20 cascades (one file per cascade).
60 | We annonymized the `user_id` (as per Twitter's ToS) by mapping original values to a sequence from 0 to n, while preserving the identity of users across cascades.
61 |
62 | ### The format cascade files:
63 | - A csv file with 3 columns (`time`, `magnitude`, `user_id`), where each row is a tweet in the cascade:
64 | - `time` represents the timestamp of tweet -- the first tweet is always at time zero, for the following retweets it shows the offset in seconds from the initial tweet;
65 | - `magnitude` is the local influence of the user (here the number of followers);
66 | - `user_id` the id of the user emitting the tweet (here annonymized).
67 | - The rows in the file (i.e. the tweets) are sorted by the timestamp;
68 |
69 | eg:
70 | ```
71 | time,magnitude,user_id
72 | 0,4674,"0"
73 | 321,1327,"1"
74 | 339,976,"2"
75 | 383,477,"3"
76 | 699,1209,"4"
77 | 824,119,"5"
78 | 835,1408,"6"
79 | 1049,896,"7"
80 | ```
81 |
82 | # Cascade influence tutorial
83 |
84 | Next, we drive you through using Cas.In for estimating user influence starting from a single cascade.
85 |
86 | ### Preliminary
87 | We need to first load all required packages of cascade influence.
88 |
89 |
90 | ```python
91 | cd scripts
92 | ```
93 |
94 | ```python
95 | import pandas as pd
96 | import numpy as np
97 | from casIn.user_influence import P,influence
98 | ```
99 |
100 | ## Compute influence in one cascade
101 |
102 | ### Read data
103 | Load the first cascade in the SMH toy dataset:
104 |
105 |
106 | ```python
107 | cascade = pd.read_csv("../data/SMH/SMH-cascade-0.csv")
108 | cascade.head()
109 | ```
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | |
119 | time |
120 | magnitude |
121 | user_id |
122 |
123 |
124 |
125 |
126 | 0 |
127 | 0 |
128 | 991 |
129 | 419 |
130 |
131 |
132 | 1 |
133 | 127 |
134 | 1352 |
135 | 658 |
136 |
137 |
138 | 2 |
139 | 2149 |
140 | 2057 |
141 | 264 |
142 |
143 |
144 | 3 |
145 | 2465 |
146 | 1155 |
147 | 1016 |
148 |
149 |
150 | 4 |
151 | 2485 |
152 | 1917 |
153 | 790 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 | ### Compute matrix P
162 |
163 | We first need to compute the probabilities , where  is the probability that  tweet is a direct retweet of the  (see the paper for more details).
164 | We need to specify the hyper-parameter , the time decay coefficient.
165 | Here we choose .
166 |
167 |
168 | ```python
169 | p_ij = P(cascade,r = -0.000068)
170 | ```
171 |
172 | ### Compute user influence and matrix M
173 | The function `influence()` will return an array of influences for each user and the matrix , where  is the influence of the  tweet of the  tweet (direct and indirect).
174 |
175 |
176 | ```python
177 | inf, m_ij = influence(p_ij)
178 | ```
179 |
180 | ### Link influence with user_id
181 |
182 | Now, we add the computed user influence back to the pandas data structure.
183 |
184 |
185 | ```python
186 | cascade["influence"] = pd.Series(inf)
187 | cascade.head()
188 | ```
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | |
198 | time |
199 | magnitude |
200 | user_id |
201 | influence |
202 |
203 |
204 |
205 |
206 | 0 |
207 | 0 |
208 | 991 |
209 | 419 |
210 | 60.000000 |
211 |
212 |
213 | 1 |
214 | 127 |
215 | 1352 |
216 | 658 |
217 | 34.590370 |
218 |
219 |
220 | 2 |
221 | 2149 |
222 | 2057 |
223 | 264 |
224 | 29.656122 |
225 |
226 |
227 | 3 |
228 | 2465 |
229 | 1155 |
230 | 1016 |
231 | 13.535845 |
232 |
233 |
234 | 4 |
235 | 2485 |
236 | 1917 |
237 | 790 |
238 | 15.913873 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 | ## Compute influence over multiple cascades
247 | ### Load function
248 | The function *casIn()* compute influence in one cascade, which basically contain all the steps described above
249 |
250 |
251 | ```python
252 | from casIn.user_influence import casIn
253 | influence = casIn(cascade_path="../data/SMH/SMH-cascade-0.csv",time_decay=-0.000068)
254 | influence.head()
255 | ```
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 | |
265 | time |
266 | magnitude |
267 | user_id |
268 | influence |
269 |
270 |
271 |
272 |
273 | 0 |
274 | 0 |
275 | 991 |
276 | 419 |
277 | 60.000000 |
278 |
279 |
280 | 1 |
281 | 127 |
282 | 1352 |
283 | 658 |
284 | 34.590370 |
285 |
286 |
287 | 2 |
288 | 2149 |
289 | 2057 |
290 | 264 |
291 | 29.656122 |
292 |
293 |
294 | 3 |
295 | 2465 |
296 | 1155 |
297 | 1016 |
298 | 13.535845 |
299 |
300 |
301 | 4 |
302 | 2485 |
303 | 1917 |
304 | 790 |
305 | 15.913873 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 | ### Load multiple cascades
314 |
315 | The SMH toy dataset contains 20 cascades for testing out Cas.In.
316 | Let's load all of them:
317 |
318 |
319 | ```python
320 | cascades = []
321 | for i in range(20):
322 | inf = casIn(cascade_path="../data/SMH/SMH-cascade-%d.csv" % i,time_decay=-0.000068)
323 | cascades.append(inf)
324 | cascades = pd.concat(cascades)
325 | ```
326 |
327 | ### Compute user influence in multiple cascades
328 |
329 | The influence of a user is by definition the mean influence of the tweets they emit.
330 | We compute the user influence as follows:
331 |
332 |
333 | ```python
334 | result = cascades.groupby("user_id").agg({"influence" : "mean"})
335 | result.sort_values("influence",ascending=False).head()
336 | ```
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 | |
346 | influence |
347 |
348 |
349 | user_id |
350 | |
351 |
352 |
353 |
354 |
355 | 734 |
356 | 214.000000 |
357 |
358 |
359 | 1225 |
360 | 205.000000 |
361 |
362 |
363 | 755 |
364 | 190.554571 |
365 |
366 |
367 | 60 |
368 | 189.557461 |
369 |
370 |
371 | 581 |
372 | 141.033129 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
--------------------------------------------------------------------------------
/Tutorial.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Cascade Influence"
8 | ]
9 | },
10 | {
11 | "cell_type": "markdown",
12 | "metadata": {},
13 | "source": [
14 | "This repository contains:\n",
15 | " - The scripts to estimate user influence from Twitter information cascades (i.e. Cas.In);\n",
16 | " - A small dataset of 20 cascades for testing Cas.In;\n",
17 | " - A hands-on tutorial to walk you through running Cas.In on real cascades."
18 | ]
19 | },
20 | {
21 | "cell_type": "markdown",
22 | "metadata": {},
23 | "source": [
24 | "### Citation\n",
25 | "The algorithm was introduced in the paper:\n",
26 | "\n",
27 | "Rizoiu, M.-A., Graham, T., Zhang, R., Zhang, Y., Ackland, R., & Xie, L. (2018). **#DebateNight: The Role and Influence of Socialbots on Twitter During the 1st 2016 U.S. Presidential Debate**. In *Proc. International AAAI Conference on Web and Social Media (ICWSM ’18)* (pp. 1–10). Stanford, CA, USA. \n",
28 | "[pdf at arxiv with supplementary material](https://arxiv.org/abs/1802.09808)\n",
29 | "\n",
30 | "**Bibtex**\n",
31 | "```\n",
32 | "@inproceedings{rizoiu2018debatenight,\n",
33 | " address = {Stanford, CA, USA},\n",
34 | " author = {Rizoiu, Marian-Andrei and Graham, Timothy and Zhang, Rui and Zhang, Yifei and Ackland, Robert and Xie, Lexing},\n",
35 | " booktitle = {International AAAI Conference on Web and Social Media (ICWSM '18)},\n",
36 | " title = {{{\\#}DebateNight: The Role and Influence of Socialbots on Twitter During the 1st 2016 U.S. Presidential Debate}},\n",
37 | " url = {https://arxiv.org/abs/1802.09808},\n",
38 | " year = {2018}\n",
39 | "}\n",
40 | "```"
41 | ]
42 | },
43 | {
44 | "cell_type": "markdown",
45 | "metadata": {},
46 | "source": [
47 | "### License\n",
48 | "Both dataset and code are distributed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license, a copy of which can be obtained following this link. If you require a different license, please contact [Yifei Zhang](mailto:yifeiacc@gmail.com), [Marian-Andrei Rizoiu](mailto:Marian-Andrei@rizoiu.eu) or [Lexing Xie](mailto:Lexing.Xie@anu.edu.au)."
49 | ]
50 | },
51 | {
52 | "cell_type": "markdown",
53 | "metadata": {},
54 | "source": [
55 | "# How to run Cas.In in a terminal:\n",
56 | "\n",
57 | "### Required packages:\n",
58 | " - python3\n",
59 | " - numpy\n",
60 | " - pandas\n",
61 | " \n",
62 | "### Arguments of Cas.In:\n",
63 | "\n",
64 | "*--cascade_path* : the path of cascade file (see the format here below). \n",
65 | "\n",
66 | "*--time_decay* : the coefficient value of time decay (hyperparameter $r$ in the paper). **Default**:-0.000068\n",
67 | "\n",
68 | "*--save2csv* : save result to csv file. **Default**: False\n",
69 | "\n",
70 | "### Command:\n",
71 | "```bash\n",
72 | "cd scripts\n",
73 | "python3 influence.py --cascade_path path/to/file\n",
74 | "```"
75 | ]
76 | },
77 | {
78 | "cell_type": "markdown",
79 | "metadata": {},
80 | "source": [
81 | "# File format and toy dataset\n",
82 | "\n",
83 | "### Dataset\n",
84 | "We provide a toy dataset -- dubbed SMH -- for testing Cas.In.\n",
85 | "It was collected in 2017 by following the Twitter handle of the Sydney Morning Herald newspaper (tweets and retweets mentioning SMH or linking to an article from SMH).\n",
86 | "The data contains 20 cascades (one file per cascade).\n",
87 | "We annonymized the `user_id` (as per Twitter's ToS) by mapping original values to a sequence from 0 to n, while preserving the identity of users across cascades.\n",
88 | "\n",
89 | "### The format cascade files:\n",
90 | " - A csv file with 3 columns (`time`, `magnitude`, `user_id`), where each row is a tweet in the cascade:\n",
91 | " - `time` represents the timestamp of tweet -- the first tweet is always at time zero, for the following retweets it shows the offset in seconds from the initial tweet;\n",
92 | " - `magnitude` is the local influence of the user (here the number of followers);\n",
93 | " - `user_id` the id of the user emitting the tweet (here annonymized).\n",
94 | " - The rows in the file (i.e. the tweets) are sorted by the timestamp;\n",
95 | " \n",
96 | "eg:\n",
97 | "```\n",
98 | "time,magnitude,user_id \n",
99 | "0,4674,\"0\"\n",
100 | "321,1327,\"1\"\n",
101 | "339,976,\"2\"\n",
102 | "383,477,\"3\"\n",
103 | "699,1209,\"4\"\n",
104 | "824,119,\"5\"\n",
105 | "835,1408,\"6\"\n",
106 | "1049,896,\"7\"\n",
107 | "```"
108 | ]
109 | },
110 | {
111 | "cell_type": "markdown",
112 | "metadata": {},
113 | "source": [
114 | "# Cascade influence tutorial\n",
115 | "\n",
116 | "Next, we drive you through using Cas.In for estimating user influence starting from a single cascade.\n",
117 | "\n",
118 | "### Preliminary\n",
119 | "We need to first load all required packages of cascade influence."
120 | ]
121 | },
122 | {
123 | "cell_type": "code",
124 | "execution_count": 1,
125 | "metadata": {
126 | "collapsed": false
127 | },
128 | "outputs": [
129 | {
130 | "name": "stdout",
131 | "output_type": "stream",
132 | "text": [
133 | "/Users/yifei/Desktop/cascade-influence/scripts\n"
134 | ]
135 | }
136 | ],
137 | "source": [
138 | "cd scripts"
139 | ]
140 | },
141 | {
142 | "cell_type": "code",
143 | "execution_count": 2,
144 | "metadata": {
145 | "collapsed": true
146 | },
147 | "outputs": [],
148 | "source": [
149 | "import pandas as pd\n",
150 | "import numpy as np\n",
151 | "from casIn.user_influence import P,influence"
152 | ]
153 | },
154 | {
155 | "cell_type": "markdown",
156 | "metadata": {},
157 | "source": [
158 | "## Compute influence in one cascade"
159 | ]
160 | },
161 | {
162 | "cell_type": "markdown",
163 | "metadata": {
164 | "collapsed": true
165 | },
166 | "source": [
167 | "### Read data\n",
168 | "Load the first cascade in the SMH toy dataset:"
169 | ]
170 | },
171 | {
172 | "cell_type": "code",
173 | "execution_count": 3,
174 | "metadata": {
175 | "collapsed": false
176 | },
177 | "outputs": [
178 | {
179 | "data": {
180 | "text/html": [
181 | "\n",
182 | "\n",
195 | "
\n",
196 | " \n",
197 | " \n",
198 | " | \n",
199 | " time | \n",
200 | " magnitude | \n",
201 | " user_id | \n",
202 | "
\n",
203 | " \n",
204 | " \n",
205 | " \n",
206 | " 0 | \n",
207 | " 0 | \n",
208 | " 991 | \n",
209 | " 419 | \n",
210 | "
\n",
211 | " \n",
212 | " 1 | \n",
213 | " 127 | \n",
214 | " 1352 | \n",
215 | " 658 | \n",
216 | "
\n",
217 | " \n",
218 | " 2 | \n",
219 | " 2149 | \n",
220 | " 2057 | \n",
221 | " 264 | \n",
222 | "
\n",
223 | " \n",
224 | " 3 | \n",
225 | " 2465 | \n",
226 | " 1155 | \n",
227 | " 1016 | \n",
228 | "
\n",
229 | " \n",
230 | " 4 | \n",
231 | " 2485 | \n",
232 | " 1917 | \n",
233 | " 790 | \n",
234 | "
\n",
235 | " \n",
236 | "
\n",
237 | "
"
238 | ],
239 | "text/plain": [
240 | " time magnitude user_id\n",
241 | "0 0 991 419\n",
242 | "1 127 1352 658\n",
243 | "2 2149 2057 264\n",
244 | "3 2465 1155 1016\n",
245 | "4 2485 1917 790"
246 | ]
247 | },
248 | "execution_count": 3,
249 | "metadata": {},
250 | "output_type": "execute_result"
251 | }
252 | ],
253 | "source": [
254 | "cascade = pd.read_csv(\"../data/SMH/SMH-cascade-0.csv\")\n",
255 | "cascade.head()"
256 | ]
257 | },
258 | {
259 | "cell_type": "markdown",
260 | "metadata": {},
261 | "source": [
262 | "### Compute matrix P\n",
263 | "\n",
264 | "We first need to compute the probabilities $p_{ij}$, where $p_{ij}$ is the probability that $j^{th}$ tweet is a direct retweet of the $i^{th}$ (see the paper for more details).\n",
265 | "We need to specify the hyper-parameter $r$, the time decay coefficient. \n",
266 | "Here we choose $r = -0.000068$."
267 | ]
268 | },
269 | {
270 | "cell_type": "code",
271 | "execution_count": 4,
272 | "metadata": {
273 | "collapsed": true
274 | },
275 | "outputs": [],
276 | "source": [
277 | "p_ij = P(cascade,r = -0.000068)"
278 | ]
279 | },
280 | {
281 | "cell_type": "markdown",
282 | "metadata": {},
283 | "source": [
284 | "### Compute user influence and matrix M\n",
285 | "The function `influence()` will return an array of influences for each user and the matrix $M = m_{ij}$, where $m_{ij}$ is the influence of the $i^{th}$ tweet of the $j^{th}$ tweet (direct and indirect)."
286 | ]
287 | },
288 | {
289 | "cell_type": "code",
290 | "execution_count": 5,
291 | "metadata": {
292 | "collapsed": true
293 | },
294 | "outputs": [],
295 | "source": [
296 | "inf, m_ij = influence(p_ij)"
297 | ]
298 | },
299 | {
300 | "cell_type": "markdown",
301 | "metadata": {},
302 | "source": [
303 | "### Link influence with user_id\n",
304 | "\n",
305 | "Now, we add the computed user influence back to the pandas data structure."
306 | ]
307 | },
308 | {
309 | "cell_type": "code",
310 | "execution_count": 6,
311 | "metadata": {
312 | "collapsed": true
313 | },
314 | "outputs": [],
315 | "source": [
316 | "cascade[\"influence\"] = pd.Series(inf)"
317 | ]
318 | },
319 | {
320 | "cell_type": "code",
321 | "execution_count": 7,
322 | "metadata": {
323 | "collapsed": false
324 | },
325 | "outputs": [
326 | {
327 | "data": {
328 | "text/html": [
329 | "\n",
330 | "\n",
343 | "
\n",
344 | " \n",
345 | " \n",
346 | " | \n",
347 | " time | \n",
348 | " magnitude | \n",
349 | " user_id | \n",
350 | " influence | \n",
351 | "
\n",
352 | " \n",
353 | " \n",
354 | " \n",
355 | " 0 | \n",
356 | " 0 | \n",
357 | " 991 | \n",
358 | " 419 | \n",
359 | " 60.000000 | \n",
360 | "
\n",
361 | " \n",
362 | " 1 | \n",
363 | " 127 | \n",
364 | " 1352 | \n",
365 | " 658 | \n",
366 | " 34.590370 | \n",
367 | "
\n",
368 | " \n",
369 | " 2 | \n",
370 | " 2149 | \n",
371 | " 2057 | \n",
372 | " 264 | \n",
373 | " 29.656122 | \n",
374 | "
\n",
375 | " \n",
376 | " 3 | \n",
377 | " 2465 | \n",
378 | " 1155 | \n",
379 | " 1016 | \n",
380 | " 13.535845 | \n",
381 | "
\n",
382 | " \n",
383 | " 4 | \n",
384 | " 2485 | \n",
385 | " 1917 | \n",
386 | " 790 | \n",
387 | " 15.913873 | \n",
388 | "
\n",
389 | " \n",
390 | "
\n",
391 | "
"
392 | ],
393 | "text/plain": [
394 | " time magnitude user_id influence\n",
395 | "0 0 991 419 60.000000\n",
396 | "1 127 1352 658 34.590370\n",
397 | "2 2149 2057 264 29.656122\n",
398 | "3 2465 1155 1016 13.535845\n",
399 | "4 2485 1917 790 15.913873"
400 | ]
401 | },
402 | "execution_count": 7,
403 | "metadata": {},
404 | "output_type": "execute_result"
405 | }
406 | ],
407 | "source": [
408 | "cascade.head()"
409 | ]
410 | },
411 | {
412 | "cell_type": "markdown",
413 | "metadata": {},
414 | "source": [
415 | "## Compute influence over multiple cascades\n",
416 | "### Load function\n",
417 | "The function *casIn()* compute influence in one cascade, which basically contain all the steps described above"
418 | ]
419 | },
420 | {
421 | "cell_type": "code",
422 | "execution_count": 8,
423 | "metadata": {
424 | "collapsed": true
425 | },
426 | "outputs": [],
427 | "source": [
428 | "from casIn.user_influence import casIn"
429 | ]
430 | },
431 | {
432 | "cell_type": "code",
433 | "execution_count": 9,
434 | "metadata": {
435 | "collapsed": false
436 | },
437 | "outputs": [
438 | {
439 | "data": {
440 | "text/html": [
441 | "\n",
442 | "\n",
455 | "
\n",
456 | " \n",
457 | " \n",
458 | " | \n",
459 | " time | \n",
460 | " magnitude | \n",
461 | " user_id | \n",
462 | " influence | \n",
463 | "
\n",
464 | " \n",
465 | " \n",
466 | " \n",
467 | " 0 | \n",
468 | " 0 | \n",
469 | " 991 | \n",
470 | " 419 | \n",
471 | " 60.000000 | \n",
472 | "
\n",
473 | " \n",
474 | " 1 | \n",
475 | " 127 | \n",
476 | " 1352 | \n",
477 | " 658 | \n",
478 | " 34.590370 | \n",
479 | "
\n",
480 | " \n",
481 | " 2 | \n",
482 | " 2149 | \n",
483 | " 2057 | \n",
484 | " 264 | \n",
485 | " 29.656122 | \n",
486 | "
\n",
487 | " \n",
488 | " 3 | \n",
489 | " 2465 | \n",
490 | " 1155 | \n",
491 | " 1016 | \n",
492 | " 13.535845 | \n",
493 | "
\n",
494 | " \n",
495 | " 4 | \n",
496 | " 2485 | \n",
497 | " 1917 | \n",
498 | " 790 | \n",
499 | " 15.913873 | \n",
500 | "
\n",
501 | " \n",
502 | "
\n",
503 | "
"
504 | ],
505 | "text/plain": [
506 | " time magnitude user_id influence\n",
507 | "0 0 991 419 60.000000\n",
508 | "1 127 1352 658 34.590370\n",
509 | "2 2149 2057 264 29.656122\n",
510 | "3 2465 1155 1016 13.535845\n",
511 | "4 2485 1917 790 15.913873"
512 | ]
513 | },
514 | "execution_count": 9,
515 | "metadata": {},
516 | "output_type": "execute_result"
517 | }
518 | ],
519 | "source": [
520 | "influence = casIn(cascade_path=\"../data/SMH/SMH-cascade-0.csv\",time_decay=-0.000068)\n",
521 | "influence.head()"
522 | ]
523 | },
524 | {
525 | "cell_type": "markdown",
526 | "metadata": {},
527 | "source": [
528 | "### Load multiple cascades\n",
529 | "\n",
530 | "The SMH toy dataset contains 20 cascades for testing out Cas.In.\n",
531 | "Let's load all of them:"
532 | ]
533 | },
534 | {
535 | "cell_type": "code",
536 | "execution_count": 10,
537 | "metadata": {
538 | "collapsed": true
539 | },
540 | "outputs": [],
541 | "source": [
542 | "cascades = []\n",
543 | "for i in range(20):\n",
544 | " inf = casIn(cascade_path=\"../data/SMH/SMH-cascade-%d.csv\" % i,time_decay=-0.000068)\n",
545 | " cascades.append(inf)\n",
546 | "cascades = pd.concat(cascades)"
547 | ]
548 | },
549 | {
550 | "cell_type": "markdown",
551 | "metadata": {},
552 | "source": [
553 | "### Compute user influence in multiple cascades\n",
554 | "\n",
555 | "The influence of a user is by definition the mean influence of the tweets they emit.\n",
556 | "We compute the user influence as follows:"
557 | ]
558 | },
559 | {
560 | "cell_type": "code",
561 | "execution_count": 11,
562 | "metadata": {
563 | "collapsed": true
564 | },
565 | "outputs": [],
566 | "source": [
567 | "result = cascades.groupby(\"user_id\").agg({\"influence\" : \"mean\"})"
568 | ]
569 | },
570 | {
571 | "cell_type": "code",
572 | "execution_count": 12,
573 | "metadata": {
574 | "collapsed": false
575 | },
576 | "outputs": [
577 | {
578 | "data": {
579 | "text/html": [
580 | "\n",
581 | "\n",
594 | "
\n",
595 | " \n",
596 | " \n",
597 | " | \n",
598 | " influence | \n",
599 | "
\n",
600 | " \n",
601 | " user_id | \n",
602 | " | \n",
603 | "
\n",
604 | " \n",
605 | " \n",
606 | " \n",
607 | " 734 | \n",
608 | " 214.000000 | \n",
609 | "
\n",
610 | " \n",
611 | " 1225 | \n",
612 | " 205.000000 | \n",
613 | "
\n",
614 | " \n",
615 | " 755 | \n",
616 | " 190.554571 | \n",
617 | "
\n",
618 | " \n",
619 | " 60 | \n",
620 | " 189.557461 | \n",
621 | "
\n",
622 | " \n",
623 | " 581 | \n",
624 | " 141.033129 | \n",
625 | "
\n",
626 | " \n",
627 | "
\n",
628 | "
"
629 | ],
630 | "text/plain": [
631 | " influence\n",
632 | "user_id \n",
633 | "734 214.000000\n",
634 | "1225 205.000000\n",
635 | "755 190.554571\n",
636 | "60 189.557461\n",
637 | "581 141.033129"
638 | ]
639 | },
640 | "execution_count": 12,
641 | "metadata": {},
642 | "output_type": "execute_result"
643 | }
644 | ],
645 | "source": [
646 | "result.sort_values(\"influence\",ascending=False).head()"
647 | ]
648 | },
649 | {
650 | "cell_type": "code",
651 | "execution_count": null,
652 | "metadata": {
653 | "collapsed": true
654 | },
655 | "outputs": [],
656 | "source": []
657 | }
658 | ],
659 | "metadata": {
660 | "kernelspec": {
661 | "display_name": "Python [Root]",
662 | "language": "python",
663 | "name": "Python [Root]"
664 | },
665 | "language_info": {
666 | "codemirror_mode": {
667 | "name": "ipython",
668 | "version": 2
669 | },
670 | "file_extension": ".py",
671 | "mimetype": "text/x-python",
672 | "name": "python",
673 | "nbconvert_exporter": "python",
674 | "pygments_lexer": "ipython2",
675 | "version": "2.7.11"
676 | }
677 | },
678 | "nbformat": 4,
679 | "nbformat_minor": 2
680 | }
681 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-0.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,991,419
3 | 127,1352,658
4 | 2149,2057,264
5 | 2465,1155,1016
6 | 2485,1917,790
7 | 2604,1484,942
8 | 2781,1474,1006
9 | 2996,1443,1064
10 | 3344,2197,491
11 | 4142,2220,1083
12 | 4208,5223,532
13 | 5004,1387,691
14 | 5324,1387,691
15 | 5526,1899,1140
16 | 5543,486,536
17 | 5626,676,559
18 | 6099,619,870
19 | 6969,620,766
20 | 8361,628,1631
21 | 9124,16912,1180
22 | 9290,411,473
23 | 9327,706,596
24 | 9525,450,800
25 | 14821,360,1441
26 | 16066,1298,371
27 | 20625,5042,932
28 | 20984,1369,8
29 | 21224,2803,465
30 | 22575,1555,285
31 | 24405,3469,1173
32 | 24442,696,1653
33 | 25705,835,1414
34 | 28484,973,307
35 | 42711,1406,471
36 | 43759,475,1424
37 | 43788,98,1516
38 | 48561,1417,1343
39 | 48641,1889,1265
40 | 48660,736,1091
41 | 48859,2238,1297
42 | 50520,4006,373
43 | 50529,2535,866
44 | 50938,506,1157
45 | 51376,1689,1107
46 | 51769,104,455
47 | 51954,2372,1065
48 | 51994,295,593
49 | 52353,1946,252
50 | 52409,443,44
51 | 52737,98,1152
52 | 53188,469,1660
53 | 53209,1051,1381
54 | 53858,3781,200
55 | 53962,276,545
56 | 58433,5,1635
57 | 64675,1881,549
58 | 86711,568,696
59 | 102008,3274,1324
60 | 152386,3196,1312
61 | 162980,407,1313
62 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-1.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,45907,81
3 | 95,12347,1547
4 | 375,1,1596
5 | 385,1,1593
6 | 390,1,1684
7 | 394,10,1617
8 | 394,1,1592
9 | 394,2,1590
10 | 395,1,1597
11 | 404,1,1591
12 | 404,1,1627
13 | 405,1,1589
14 | 406,1,1595
15 | 412,1,1588
16 | 418,1,1583
17 | 423,1,1604
18 | 423,1,1586
19 | 424,1,1599
20 | 424,1,1584
21 | 427,1,1611
22 | 431,1,1598
23 | 435,1,1594
24 | 435,1,1605
25 | 440,2,1608
26 | 441,3,1585
27 | 448,7,1606
28 | 448,1,1587
29 | 453,1,1600
30 | 455,1,1602
31 | 455,1,1610
32 | 456,1,1609
33 | 457,1,1603
34 | 459,1,1607
35 | 461,3,1618
36 | 461,8010,398
37 | 463,1,1601
38 | 650,224,1680
39 | 1563,612,20
40 | 1861,1423,1363
41 | 1861,11851,1311
42 | 21229,45906,81
43 | 32024,17371,1230
44 | 32511,476,1670
45 | 62363,558,206
46 | 62423,1617,1615
47 | 62460,5241,2
48 | 80581,82410,319
49 | 80581,28,1694
50 | 98564,1163,1158
51 | 282694,58612,1537
52 | 295062,14858,1620
53 | 319136,2192,645
54 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-10.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,7241,1383
3 | 65,2118,744
4 | 100,1321,783
5 | 123,1163,585
6 | 317,1555,1638
7 | 524,433,427
8 | 541,46,210
9 | 667,2517,1171
10 | 1110,1646,758
11 | 1406,1650,820
12 | 1708,941,1014
13 | 2434,1671,366
14 | 3366,786,673
15 | 3747,81,787
16 | 3785,463,1544
17 | 5166,1921,1140
18 | 5368,603,978
19 | 7627,86,1690
20 | 9715,1023,1435
21 | 9729,13504,772
22 | 9976,12,1693
23 | 11917,3228,1406
24 | 12314,1400,1644
25 | 12472,7999,354
26 | 12622,3433,1408
27 | 12659,1918,1017
28 | 13434,8138,1052
29 | 17628,2724,330
30 | 23061,5636,1623
31 | 29861,514,1376
32 | 34966,509,732
33 | 35529,637,1466
34 | 36557,1279,348
35 | 36939,734,205
36 | 37931,1720,1034
37 | 38980,3534,1205
38 | 39314,615,878
39 | 39397,1053,1185
40 | 40667,4118,373
41 | 41146,1188,1155
42 | 42171,1200,350
43 | 43675,136,1251
44 | 47907,168,622
45 | 48312,562,1349
46 | 49260,1864,1187
47 | 49902,536,773
48 | 50825,2339,1087
49 | 52469,262,1384
50 | 54898,1574,487
51 | 59755,266,1097
52 | 63612,167,1281
53 | 64777,4585,652
54 | 68985,364,411
55 | 78167,1595,1216
56 | 84629,43,1260
57 | 168081,1138,956
58 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-11.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,22486,215
3 | 215,6658,996
4 | 233,1068,890
5 | 357,65,1020
6 | 380,4016,161
7 | 482,393,1275
8 | 505,1598,808
9 | 1006,248,241
10 | 1271,1566,840
11 | 1772,753,786
12 | 2022,396,1300
13 | 2083,720,747
14 | 2162,151,1240
15 | 2490,521,1341
16 | 2831,480,1101
17 | 3339,306,148
18 | 3385,176,847
19 | 4298,1690,1248
20 | 4355,1565,564
21 | 4539,83,1512
22 | 5527,2382,578
23 | 5558,606,878
24 | 6582,3250,1118
25 | 6697,2014,924
26 | 7461,1403,974
27 | 7688,355,41
28 | 8930,282,835
29 | 14297,2580,18
30 | 15916,548,696
31 | 16322,251,442
32 | 17033,2130,1297
33 | 20204,120107,375
34 | 20249,744,1303
35 | 20305,740,434
36 | 20425,109,1326
37 | 20459,576,171
38 | 20625,602,680
39 | 21642,1052,503
40 | 25383,7409,494
41 | 25522,35,688
42 | 26814,537,759
43 | 27241,3689,432
44 | 27547,430,312
45 | 27558,261,694
46 | 30684,1171,983
47 | 30845,1853,426
48 | 33701,3898,40
49 | 34914,670,1132
50 | 35778,12879,772
51 | 35807,7782,354
52 | 36666,2719,409
53 | 36915,1217,163
54 | 37097,110,1326
55 | 37723,662,1284
56 | 38789,238,962
57 | 39916,541,452
58 | 40721,2948,776
59 | 41169,235,1018
60 | 41355,1639,699
61 | 43835,726,391
62 | 44088,218,518
63 | 44574,206,1072
64 | 50887,3014,64
65 | 51799,349,1238
66 | 53986,58,421
67 | 56465,3001,1406
68 | 81268,58,815
69 | 82866,450,775
70 | 83098,3994,1123
71 | 83246,5121,532
72 | 83465,2231,1430
73 | 100999,1393,896
74 | 111940,8,1573
75 | 124554,2310,1153
76 | 266563,129,1492
77 | 266914,3696,200
78 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-12.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,2353,734
3 | 568,4405,581
4 | 859,1133,1183
5 | 964,1619,808
6 | 1295,3838,1166
7 | 2004,2516,752
8 | 2497,3215,1406
9 | 2922,50953,43
10 | 3015,1472,488
11 | 3051,1431,1431
12 | 3053,14835,1074
13 | 3109,4537,1005
14 | 3110,1483,13
15 | 3139,159,101
16 | 3262,702,11
17 | 3351,140,1517
18 | 3744,2906,856
19 | 3848,319,1468
20 | 4010,107,1116
21 | 4010,292,990
22 | 4025,8307,509
23 | 4146,2972,482
24 | 4335,1160,1075
25 | 4545,175,293
26 | 4784,388,979
27 | 4913,154,147
28 | 5302,746,766
29 | 6325,820,986
30 | 7463,294,582
31 | 9905,8768,671
32 | 10082,958,204
33 | 11088,1450,823
34 | 11244,286,1263
35 | 11585,290,833
36 | 11638,958,548
37 | 12015,113,1078
38 | 12042,1962,684
39 | 12163,109,455
40 | 12601,6585,554
41 | 12812,554,353
42 | 12970,653,641
43 | 12990,3222,1312
44 | 13246,1588,882
45 | 13879,1541,555
46 | 14020,716,1433
47 | 14076,8850,811
48 | 14129,10504,557
49 | 14592,2897,433
50 | 14611,574,696
51 | 15057,1222,721
52 | 15076,1188,973
53 | 15186,2422,1148
54 | 15304,2384,1065
55 | 15477,2101,1280
56 | 15714,8726,77
57 | 15793,1287,733
58 | 15804,1028,1630
59 | 15816,1346,552
60 | 15879,4708,405
61 | 15896,78,770
62 | 16057,202,349
63 | 16503,572,1023
64 | 16780,266,1099
65 | 16803,311,715
66 | 16823,11790,933
67 | 16868,2511,1257
68 | 16940,1283,1671
69 | 17144,1315,257
70 | 17307,2356,149
71 | 17502,607,862
72 | 17545,2208,1569
73 | 17611,542,154
74 | 17824,1863,1187
75 | 18092,1315,163
76 | 18281,362,745
77 | 19067,70,1339
78 | 19362,1933,1060
79 | 19743,2195,768
80 | 19869,1452,1343
81 | 19966,97,1628
82 | 20052,369,1238
83 | 20170,418,1426
84 | 20204,170,297
85 | 20389,64,1564
86 | 20831,926,226
87 | 21046,3614,1150
88 | 21730,1615,840
89 | 21742,408,334
90 | 22238,61,779
91 | 22248,2341,1082
92 | 22756,727,65
93 | 23046,753,1653
94 | 23902,2006,1046
95 | 23927,1110,1323
96 | 24091,3291,850
97 | 24113,813,695
98 | 24248,283,1086
99 | 24297,717,655
100 | 24329,1875,792
101 | 24585,2568,1170
102 | 25113,431,738
103 | 25198,539,269
104 | 25263,41,739
105 | 27059,1697,915
106 | 27378,359,1304
107 | 29124,1555,254
108 | 29990,526,1346
109 | 31609,4978,631
110 | 31747,541,1147
111 | 31895,4804,643
112 | 32004,230,1120
113 | 32019,712,553
114 | 32172,390,345
115 | 32216,66,1392
116 | 33273,612,209
117 | 34597,3624,955
118 | 34786,976,916
119 | 35725,1248,893
120 | 35895,18760,277
121 | 35979,858,1163
122 | 36113,630,1261
123 | 36150,1650,464
124 | 36384,171,822
125 | 36424,909,105
126 | 36507,581,504
127 | 36564,3225,748
128 | 36658,323,1305
129 | 37255,721,906
130 | 37436,358,478
131 | 37522,4560,461
132 | 37907,114,119
133 | 38510,424,427
134 | 39387,23,1688
135 | 39650,969,1283
136 | 39836,479,1335
137 | 39978,903,500
138 | 40278,4004,661
139 | 45655,394,225
140 | 49424,274,1258
141 | 49688,5551,785
142 | 49947,1099,115
143 | 52674,695,401
144 | 55891,517,719
145 | 60479,539,1168
146 | 64878,684,1015
147 | 65431,170,79
148 | 68089,449,44
149 | 69990,4097,301
150 | 70153,165,898
151 | 70348,3157,1378
152 | 70456,2259,1297
153 | 70976,524,606
154 | 71646,3527,743
155 | 71959,64,1188
156 | 72040,1017,646
157 | 72801,3947,927
158 | 72884,752,1390
159 | 72924,3093,611
160 | 73069,1537,712
161 | 73170,794,1358
162 | 73341,1192,350
163 | 73557,3332,1324
164 | 73776,995,127
165 | 74080,864,363
166 | 75848,377,1364
167 | 76522,21,1624
168 | 76845,1411,691
169 | 77441,337,374
170 | 78395,8468,416
171 | 78820,1798,239
172 | 79276,371,993
173 | 80156,874,1459
174 | 80209,665,1470
175 | 80625,806,747
176 | 80728,3132,64
177 | 80847,368,1331
178 | 81154,3536,1205
179 | 81818,835,667
180 | 81835,327,1250
181 | 82542,412,1313
182 | 86056,2199,491
183 | 87993,28,412
184 | 88580,436,1252
185 | 90665,231,283
186 | 90845,375,1210
187 | 91102,4306,230
188 | 91123,3868,6
189 | 91147,1866,47
190 | 91425,932,1110
191 | 91983,2371,1430
192 | 91986,6751,72
193 | 92514,582,1149
194 | 93447,547,309
195 | 93517,374,1229
196 | 94177,773,592
197 | 97893,1312,371
198 | 100284,2370,485
199 | 101567,202,1122
200 | 102211,300,296
201 | 102519,182,474
202 | 103030,347,798
203 | 104309,1160,172
204 | 108223,2612,845
205 | 108608,1834,565
206 | 108720,1038,1185
207 | 109265,3058,511
208 | 111356,109,197
209 | 113933,1582,1216
210 | 116679,1311,337
211 | 121031,1058,1058
212 | 121230,452,1356
213 | 123107,2631,991
214 | 124436,613,878
215 | 195809,58,1510
216 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-13.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,6312,706
3 | 575,192,174
4 | 671,2089,1156
5 | 1733,6076,272
6 | 2204,607,113
7 | 2296,62,1471
8 | 2751,1567,487
9 | 4019,1598,875
10 | 4147,3095,1095
11 | 4161,271,242
12 | 4280,659,543
13 | 4306,226,570
14 | 4452,958,469
15 | 5328,2271,997
16 | 5363,1277,1013
17 | 5519,176,293
18 | 6372,1762,339
19 | 6469,4835,265
20 | 7222,669,203
21 | 8319,603,1167
22 | 9165,829,9
23 | 9809,579,883
24 | 11811,1447,1370
25 | 12922,700,540
26 | 13537,1019,891
27 | 14873,750,1390
28 | 15278,3425,1338
29 | 15535,502,1318
30 | 15931,4851,53
31 | 15970,1499,259
32 | 16174,349,42
33 | 16277,1453,869
34 | 16341,50747,43
35 | 16374,1453,869
36 | 16462,766,796
37 | 16639,4211,284
38 | 16756,780,1301
39 | 16771,4725,1206
40 | 16976,205,372
41 | 17144,1730,1432
42 | 17168,2489,1319
43 | 17331,7909,354
44 | 17367,125,1649
45 | 17498,3720,567
46 | 17711,538,1481
47 | 17792,778,960
48 | 18009,4865,1129
49 | 18083,1211,663
50 | 18224,2471,752
51 | 18380,11552,58
52 | 18600,1622,808
53 | 20438,56,1386
54 | 21543,1560,967
55 | 22957,3446,295
56 | 22966,3468,1173
57 | 23180,626,1579
58 | 23223,14766,1074
59 | 23368,5518,785
60 | 24031,7460,164
61 | 24242,843,1093
62 | 24297,450,716
63 | 25624,3743,1262
64 | 25822,252,477
65 | 25848,527,719
66 | 26042,460,1398
67 | 26740,944,1027
68 | 43675,372,1229
69 | 45368,1914,790
70 | 45723,73,1244
71 | 49233,193,860
72 | 49995,173,1413
73 | 50336,411,1423
74 | 50390,25,1675
75 | 50699,2180,998
76 | 50825,1027,1282
77 | 51318,405,427
78 | 51419,4216,344
79 | 55017,2312,657
80 | 55204,1272,163
81 | 55391,2500,1257
82 | 55450,4987,1449
83 | 56826,411,1313
84 | 56841,2439,578
85 | 58556,623,1164
86 | 59689,1482,974
87 | 60008,1515,816
88 | 62269,785,1048
89 | 65971,495,1249
90 | 67556,1250,1161
91 | 68000,8803,811
92 | 73055,481,617
93 | 79188,1201,1559
94 | 79233,339,1105
95 | 79921,458,1398
96 | 82037,921,809
97 | 84713,2318,616
98 | 89997,2276,1081
99 | 94370,2743,409
100 | 100988,907,1469
101 | 102079,2727,952
102 | 102397,1150,698
103 | 180889,1364,658
104 | 182128,1337,556
105 | 221903,1064,1055
106 | 256281,3659,361
107 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-14.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,2753,1061
3 | 22,242,1668
4 | 68,1135,519
5 | 603,3084,611
6 | 1252,1879,426
7 | 1356,249,1092
8 | 1534,1422,1172
9 | 2886,846,333
10 | 8158,1357,1049
11 | 8360,682,559
12 | 9104,2074,1581
13 | 9515,369,1151
14 | 9594,705,540
15 | 10389,384,336
16 | 11626,3121,64
17 | 22504,452,947
18 | 31470,202,1646
19 | 38932,957,1193
20 | 38986,7789,1485
21 | 39010,647,760
22 | 39034,6804,996
23 | 39109,86,1685
24 | 39386,1020,1419
25 | 39700,225,1551
26 | 40762,739,1213
27 | 41469,7473,182
28 | 41482,13265,772
29 | 42216,4219,889
30 | 42737,1484,668
31 | 43016,713,655
32 | 44639,2360,346
33 | 45830,761,234
34 | 47584,2373,1065
35 | 47627,963,446
36 | 48820,572,1562
37 | 49092,2155,678
38 | 49114,2056,1377
39 | 49178,1828,565
40 | 49589,1089,525
41 | 51074,503,789
42 | 51170,492,944
43 | 51642,662,920
44 | 51683,1345,145
45 | 53904,578,504
46 | 56409,2119,327
47 | 58213,1708,266
48 | 58656,1489,1292
49 | 59880,797,1104
50 | 60690,1204,1131
51 | 60855,522,1346
52 | 61355,1299,1133
53 | 61654,1808,466
54 | 62373,995,1096
55 | 62716,349,798
56 | 63163,188,231
57 | 66295,814,1128
58 | 67660,1692,1264
59 | 67891,397,1357
60 | 71077,202,524
61 | 71369,375,1364
62 | 73379,1370,658
63 | 73402,3227,89
64 | 73459,3056,1236
65 | 73495,2223,1011
66 | 73521,82,1085
67 | 73585,822,986
68 | 75251,126,697
69 | 75361,3347,1408
70 | 75686,1913,1140
71 | 77902,2519,959
72 | 77935,796,1358
73 | 78704,9539,492
74 | 79590,265,824
75 | 80095,1264,550
76 | 80414,978,307
77 | 80584,2695,690
78 | 80712,865,262
79 | 80775,490,542
80 | 80939,279,1543
81 | 81098,386,1028
82 | 81322,33,782
83 | 81792,252,818
84 | 82491,3276,850
85 | 82717,729,1033
86 | 83280,1626,366
87 | 86734,863,1417
88 | 88414,1154,172
89 | 88508,14810,1074
90 | 88807,1306,163
91 | 89069,261,722
92 | 89323,361,1304
93 | 89426,917,383
94 | 89711,1193,350
95 | 89857,1482,1006
96 | 90247,2316,1634
97 | 90258,2088,76
98 | 90402,97,1674
99 | 90406,496,1550
100 | 90795,2498,752
101 | 91992,1584,564
102 | 92469,1281,1008
103 | 92495,1053,1058
104 | 92569,596,751
105 | 92700,1702,449
106 | 92717,1702,449
107 | 93292,624,467
108 | 96311,925,1110
109 | 98046,182,186
110 | 109291,160,919
111 | 121030,409,1423
112 | 123656,166,1413
113 | 125413,357,529
114 | 127026,1927,1060
115 | 127120,2239,170
116 | 127324,2548,547
117 | 127720,1186,1212
118 | 132356,1141,585
119 | 140551,771,592
120 | 148192,1809,814
121 | 160465,442,728
122 | 298884,2363,485
123 | 299114,828,1434
124 | 300710,174,742
125 | 300805,1429,62
126 | 303201,3155,1378
127 | 303239,8847,811
128 | 303282,1679,935
129 | 304299,173,560
130 | 307138,1447,98
131 | 307406,1177,654
132 | 324190,478,1424
133 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-15.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,678,1612
3 | 1220,117,117
4 | 3871,576,1124
5 | 4868,18109,755
6 | 4903,374,109
7 | 4903,11757,118
8 | 4911,5630,120
9 | 4981,1642,975
10 | 5095,1629,1214
11 | 5554,1924,484
12 | 5674,7896,1485
13 | 5697,8665,238
14 | 5776,2957,1089
15 | 5797,626,111
16 | 5820,3390,5
17 | 5908,4116,458
18 | 6188,880,493
19 | 6253,820,766
20 | 6790,1701,1264
21 | 7134,2758,952
22 | 7552,283,1100
23 | 7598,677,714
24 | 7666,8517,793
25 | 7704,78,573
26 | 7799,153,505
27 | 7832,5062,1449
28 | 7900,224,1299
29 | 8422,4129,134
30 | 8559,2185,1007
31 | 8582,4578,652
32 | 9056,3417,380
33 | 9630,1197,54
34 | 11280,13434,772
35 | 11508,932,425
36 | 11900,1067,730
37 | 13045,16,1572
38 | 15881,6363,674
39 | 16107,2125,1203
40 | 16253,1003,343
41 | 16328,3795,567
42 | 16652,1709,929
43 | 16791,318,1002
44 | 23212,89,1499
45 | 25868,88,1322
46 | 25869,166,926
47 | 26753,802,1104
48 | 27593,488,943
49 | 27727,628,326
50 | 29567,1738,1134
51 | 29972,2127,327
52 | 37417,2509,752
53 | 37990,3638,1150
54 | 38901,1332,163
55 | 39266,312,741
56 | 40995,573,410
57 | 43527,381,1285
58 | 43851,816,1328
59 | 45358,186,1374
60 | 45608,231,1682
61 | 47232,5252,723
62 | 48197,1149,585
63 | 49538,302,1525
64 | 84804,442,440
65 | 117977,4313,1308
66 | 118876,436,728
67 | 144650,4315,613
68 | 144673,9545,66
69 | 182197,2301,1047
70 | 183493,4941,584
71 | 317106,600,1146
72 | 578431,137,1640
73 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-16.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,2733,880
3 | 89,1368,163
4 | 1821,1817,466
5 | 1992,2204,1280
6 | 2271,2282,1297
7 | 2642,2381,912
8 | 3311,198,1665
9 | 4601,3841,567
10 | 4822,451,660
11 | 6845,1921,1041
12 | 7312,14901,1074
13 | 7478,1074,1185
14 | 8052,1677,323
15 | 8186,354,1463
16 | 8229,750,3
17 | 8467,927,766
18 | 9036,11976,302
19 | 9058,1148,761
20 | 9396,2302,998
21 | 9571,1750,1224
22 | 9804,1676,366
23 | 10332,2849,1553
24 | 10859,2830,1061
25 | 12756,711,1179
26 | 15521,2632,75
27 | 15703,1285,550
28 | 16403,2599,1634
29 | 17213,370,767
30 | 17778,2720,18
31 | 17871,3685,1150
32 | 20140,3642,1173
33 | 20670,3209,1540
34 | 21323,1765,836
35 | 23584,806,1104
36 | 27308,314,586
37 | 30104,2521,1257
38 | 30682,4235,1447
39 | 30729,1487,823
40 | 32252,349,1238
41 | 32519,1305,1008
42 | 33478,2367,149
43 | 33850,2225,709
44 | 34122,884,551
45 | 34697,1241,1362
46 | 35300,2483,112
47 | 38048,1436,691
48 | 79750,1709,915
49 | 79765,9010,811
50 | 80476,1068,1159
51 | 89196,292,1106
52 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-17.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,681830,60
3 | 42,2313,799
4 | 55,2009,395
5 | 295,3911,168
6 | 453,1515,1066
7 | 746,521,727
8 | 889,342,812
9 | 1778,165,423
10 | 1833,60,988
11 | 2196,25,1528
12 | 3262,579,352
13 | 3730,7658,977
14 | 3865,18523,74
15 | 5583,123,700
16 | 6414,8,1677
17 | 6558,142,1368
18 | 7512,3314,857
19 | 7927,422,1270
20 | 8296,3355,144
21 | 9079,114,221
22 | 10949,318,281
23 | 18648,16,1295
24 | 20692,177,848
25 | 20782,54,873
26 | 24180,80,30
27 | 27421,3800,679
28 | 36689,847,61
29 | 37396,1945,218
30 | 39920,4319,1121
31 | 41587,117,1412
32 | 43669,688,1125
33 | 43734,50,1480
34 | 44364,3352,1509
35 | 45957,33542,385
36 | 46996,3715,432
37 | 47744,6402,253
38 | 48001,2943,637
39 | 48418,103048,338
40 | 50011,202,907
41 | 51211,43,749
42 | 51465,152,57
43 | 52038,652,288
44 | 56508,291,1138
45 | 56591,31,707
46 | 56730,4644,498
47 | 57008,75,801
48 | 57743,1590,871
49 | 58942,191,861
50 | 60125,43,439
51 | 60257,1,1354
52 | 61568,2049,502
53 | 63029,169,38
54 | 63226,8658,80
55 | 64134,6123,572
56 | 65640,8391,388
57 | 67278,20088,950
58 | 68507,756,1371
59 | 72100,38,1535
60 | 74784,1523,963
61 | 76965,10,832
62 | 77420,14,1457
63 | 77724,341,1360
64 | 78221,59,1676
65 | 80838,117,125
66 | 93861,49,804
67 | 95578,982,921
68 | 110616,1258,992
69 | 114618,1346,803
70 | 116503,53,852
71 | 162958,288,1421
72 | 167039,1011,982
73 | 175724,19349,166
74 | 181437,321,1552
75 | 255895,3403,1338
76 | 257055,3,1642
77 | 1085159,1,1681
78 | 1402292,4,1679
79 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-18.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,5020,1225
3 | 16,1274,368
4 | 95,363,1350
5 | 98,1499,1467
6 | 148,5029,538
7 | 172,134,868
8 | 306,696,807
9 | 343,401,1423
10 | 502,1432,486
11 | 510,2529,547
12 | 586,220,881
13 | 595,1436,802
14 | 749,742,175
15 | 812,2305,485
16 | 851,157,1413
17 | 853,4569,90
18 | 972,2381,574
19 | 1111,1212,546
20 | 1161,1686,266
21 | 1166,1854,1187
22 | 1247,110,953
23 | 1890,983,1336
24 | 1911,8745,811
25 | 1958,5237,632
26 | 1983,3997,370
27 | 1993,950,1193
28 | 2033,4934,631
29 | 2123,185,1669
30 | 2133,3854,594
31 | 2161,4778,99
32 | 2187,577,152
33 | 2290,1212,198
34 | 2346,956,325
35 | 2347,438,516
36 | 2503,107,1640
37 | 2536,1542,406
38 | 2840,1672,88
39 | 2854,960,56
40 | 3411,624,1466
41 | 3449,938,662
42 | 3771,919,1526
43 | 4157,3728,151
44 | 4504,2077,1142
45 | 4631,6993,879
46 | 4883,2398,1051
47 | 5002,1954,1135
48 | 5159,850,157
49 | 5174,3083,64
50 | 5223,50,463
51 | 5240,7455,182
52 | 5951,524,599
53 | 5975,1052,1323
54 | 6230,709,205
55 | 6302,324,331
56 | 6326,391,1347
57 | 6731,602,113
58 | 6797,2752,522
59 | 6814,511,303
60 | 6833,29086,1232
61 | 7275,1879,1490
62 | 7610,1421,1343
63 | 8070,1872,1060
64 | 8456,953,1039
65 | 8596,5489,785
66 | 9014,1603,366
67 | 9138,1386,939
68 | 9482,257,1175
69 | 9540,1853,753
70 | 9772,1920,358
71 | 9858,222,980
72 | 9913,1373,669
73 | 9920,2361,444
74 | 10376,414,1253
75 | 10413,22290,16
76 | 10446,1676,929
77 | 10482,4767,1498
78 | 10509,76,377
79 | 10599,356,299
80 | 10614,6340,342
81 | 10859,709,1351
82 | 10862,1543,797
83 | 10880,51,1632
84 | 10895,5877,39
85 | 11100,1585,324
86 | 11961,1914,1400
87 | 12099,254,1530
88 | 12593,1189,45
89 | 12728,544,620
90 | 13395,99,1506
91 | 14077,2677,1069
92 | 14193,287,1397
93 | 15111,120,189
94 | 16645,672,1425
95 | 16873,57,853
96 | 16999,3213,1220
97 | 17095,1027,1380
98 | 17207,671,1201
99 | 17419,246,1444
100 | 17459,329,459
101 | 17719,2986,636
102 | 17778,362,1045
103 | 18370,1218,762
104 | 19307,57,1661
105 | 19822,182,1472
106 | 20614,949,1365
107 | 20651,256,1090
108 | 20792,1218,1395
109 | 21134,543,1372
110 | 21596,195,300
111 | 22078,2891,1228
112 | 22191,2476,571
113 | 22201,404,1031
114 | 22267,202,1420
115 | 22301,59,1647
116 | 22509,1731,1224
117 | 23157,1184,1212
118 | 23191,3480,173
119 | 24610,1849,1108
120 | 24833,3434,295
121 | 25031,4000,370
122 | 25322,2186,709
123 | 25508,1541,21
124 | 25524,1422,1259
125 | 25923,531,607
126 | 25970,1522,1216
127 | 26017,2268,685
128 | 26881,723,1332
129 | 27153,30,1567
130 | 27347,314,1404
131 | 27782,17,639
132 | 28432,2258,867
133 | 28741,254,1194
134 | 29507,110,1549
135 | 30084,1076,1077
136 | 30108,119,1330
137 | 30322,7906,354
138 | 30470,259,1393
139 | 30611,861,268
140 | 30937,2103,703
141 | 31819,327,1614
142 | 32475,477,1024
143 | 32955,1020,304
144 | 34333,231,477
145 | 36251,116,1575
146 | 36914,341,1288
147 | 37218,1383,475
148 | 38519,84,1655
149 | 41223,276,1625
150 | 43022,385,903
151 | 43736,207,1500
152 | 43909,2675,330
153 | 44162,234,243
154 | 44538,377,103
155 | 45596,142,1494
156 | 45705,104,1385
157 | 49045,2466,415
158 | 52321,27,1366
159 | 55485,1164,757
160 | 55560,1047,764
161 | 57264,56,1246
162 | 59945,3834,754
163 | 61664,301,1165
164 | 61965,40,1664
165 | 62002,10,1563
166 | 62019,1637,1184
167 | 64032,51,1396
168 | 64124,543,282
169 | 66847,1636,37
170 | 71000,337,918
171 | 71863,743,396
172 | 72963,10072,83
173 | 73590,3677,68
174 | 73834,3998,886
175 | 74158,4685,82
176 | 77110,297,651
177 | 79341,18,1580
178 | 81308,3025,895
179 | 87462,507,1401
180 | 88670,129,1326
181 | 90312,547,504
182 | 90470,2610,102
183 | 90546,585,1126
184 | 91463,6404,121
185 | 94712,992,130
186 | 96253,2387,574
187 | 96350,15285,923
188 | 97524,390,914
189 | 101080,185,1314
190 | 104860,200,1515
191 | 105054,41,994
192 | 105692,2860,482
193 | 106589,593,961
194 | 133746,502,310
195 | 133763,3101,858
196 | 133958,4859,1129
197 | 136545,327,725
198 | 143753,62,899
199 | 161916,610,922
200 | 173366,97,1483
201 | 178359,576,1208
202 | 180976,32,1639
203 | 184199,242,864
204 | 502967,1080,462
205 | 603327,358,1204
206 | 606346,908,1176
207 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-19.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,18634,755
3 | 33,2359,533
4 | 38,365,470
5 | 73,12,1493
6 | 89,1448,247
7 | 179,687117,60
8 | 199,277,1099
9 | 207,1153,1207
10 | 220,767,624
11 | 231,269,73
12 | 240,483,1196
13 | 243,2126,32
14 | 302,58401,640
15 | 329,1355,10
16 | 343,1214,445
17 | 369,2309,4
18 | 401,2166,318
19 | 417,88,1241
20 | 420,741,635
21 | 440,30,250
22 | 442,742,316
23 | 462,186,648
24 | 467,1045,908
25 | 494,2282,1297
26 | 523,34,1514
27 | 533,29923,87
28 | 584,145,255
29 | 648,347,872
30 | 687,1915,792
31 | 707,1871,1568
32 | 708,471,775
33 | 713,134,367
34 | 737,108,1289
35 | 827,72,1340
36 | 829,376,1613
37 | 854,52,1279
38 | 860,1112,1329
39 | 1094,1147,1294
40 | 1102,24,625
41 | 1110,105,1054
42 | 1139,133,308
43 | 1143,913,110
44 | 1227,1948,821
45 | 1302,1062,67
46 | 1373,877,1163
47 | 1390,809,904
48 | 1461,817,29
49 | 1649,3646,1022
50 | 1676,6394,674
51 | 1701,115,1327
52 | 1710,482,19
53 | 1734,1544,507
54 | 1764,3841,567
55 | 1815,425,562
56 | 1826,653,1062
57 | 1885,1,1084
58 | 1921,337,14
59 | 1957,975,365
60 | 2004,4816,981
61 | 2076,1,1686
62 | 2092,1304,1008
63 | 2113,1353,653
64 | 2264,162,1199
65 | 2360,118,1103
66 | 2451,554,1275
67 | 2567,82,1564
68 | 2580,1133,1448
69 | 2638,43,1641
70 | 2742,1405,1545
71 | 2779,1582,487
72 | 2930,816,451
73 | 2933,397,468
74 | 2964,12027,143
75 | 3007,782,527
76 | 3132,62,1009
77 | 3138,2252,1083
78 | 3181,64,1044
79 | 3387,34,1508
80 | 3392,514,1422
81 | 3503,2480,485
82 | 3533,157,1582
83 | 3574,12,940
84 | 3739,354,798
85 | 3780,96,212
86 | 3875,350,178
87 | 3893,382,989
88 | 4158,5598,785
89 | 4371,1667,223
90 | 4371,21,495
91 | 4458,139,615
92 | 4528,434,1571
93 | 4594,1687,360
94 | 4634,8004,1485
95 | 4759,4558,1189
96 | 4808,2558,547
97 | 4953,2526,1171
98 | 5136,556,508
99 | 5248,28,429
100 | 5320,1300,534
101 | 5556,186,693
102 | 6089,231,193
103 | 6338,1603,314
104 | 6453,158,656
105 | 6466,30,1373
106 | 6865,143,490
107 | 7027,127,1073
108 | 7322,32,362
109 | 7332,144,1109
110 | 7605,1673,84
111 | 7650,1460,1064
112 | 7918,794,96
113 | 8179,1858,279
114 | 8217,5135,1654
115 | 8235,786,489
116 | 8271,1043,737
117 | 8422,2916,595
118 | 9209,16,843
119 | 9448,1184,36
120 | 9819,994,59
121 | 10052,1747,266
122 | 10077,12,1666
123 | 10081,963,1266
124 | 10274,242,686
125 | 10370,19,1629
126 | 10636,4,580
127 | 10675,924,666
128 | 10829,1236,198
129 | 10946,2302,1004
130 | 11008,2302,998
131 | 11180,1098,273
132 | 11374,2263,678
133 | 11464,248,298
134 | 11469,1289,938
135 | 11477,122,1622
136 | 11623,839,535
137 | 11769,64,1056
138 | 12075,1884,1108
139 | 12844,1914,271
140 | 12964,12,443
141 | 13969,1683,322
142 | 14085,114,123
143 | 14219,1620,1211
144 | 14244,17,1464
145 | 14250,6435,245
146 | 15350,68,292
147 | 16458,381,457
148 | 17253,810,621
149 | 17424,136,1560
150 | 17805,1365,1503
151 | 17902,89,274
152 | 18134,52427,670
153 | 18165,17756,22
154 | 18177,113,1486
155 | 18195,873,404
156 | 18239,667,55
157 | 18244,6037,1190
158 | 18287,4995,1129
159 | 18300,3023,776
160 | 18324,323,1505
161 | 18932,1485,1342
162 | 19101,1021,483
163 | 19114,23905,609
164 | 19284,2839,386
165 | 19358,2428,1277
166 | 19481,319,1658
167 | 19483,482,1570
168 | 19561,226,1402
169 | 19846,264,1222
170 | 19907,1708,1264
171 | 20053,559,142
172 | 20156,85,526
173 | 20331,68,791
174 | 20602,107,717
175 | 20618,29,33
176 | 21217,227,523
177 | 22204,113,1035
178 | 22581,98,934
179 | 23888,31,237
180 | 24268,839,1177
181 | 24802,17,1488
182 | 25165,112586,531
183 | 25260,1719,387
184 | 25284,67,1394
185 | 25332,366,24
186 | 25388,2471,1148
187 | 25474,9,1691
188 | 25740,39,726
189 | 25743,524,414
190 | 25852,1346,948
191 | 25921,46,539
192 | 25945,989,788
193 | 25960,225,951
194 | 25974,1129,519
195 | 25985,775,1114
196 | 26040,104,945
197 | 26226,39,244
198 | 26301,72,623
199 | 26513,151,1407
200 | 27085,1561,335
201 | 27092,158,216
202 | 27144,426,1388
203 | 27207,2776,604
204 | 27557,108,1037
205 | 27651,89,1021
206 | 27706,367,1320
207 | 28159,122,1637
208 | 28684,43,647
209 | 28880,367,219
210 | 29227,3705,432
211 | 29273,416,1475
212 | 29325,244,63
213 | 29437,59,1367
214 | 29631,39,1574
215 | 29968,1557,418
216 | 30331,1023,590
217 | 31370,261,589
218 | 31566,983,806
219 | 31621,1,1025
220 | 31679,945,1010
221 | 31830,41,813
222 | 31967,3529,1247
223 | 32612,1535,1292
224 | 32705,1053,217
225 | 33325,19,1403
226 | 34428,308,1501
227 | 34476,300,158
228 | 34950,3079,46
229 | 35275,2035,1461
230 | 35494,36,780
231 | 36165,2001,1286
232 | 36317,36,1652
233 | 37037,1456,263
234 | 37359,2050,711
235 | 37494,1181,585
236 | 37520,8,1656
237 | 37697,4308,1308
238 | 37849,1710,577
239 | 37922,312,1389
240 | 38075,11751,58
241 | 38537,1263,78
242 | 38934,333,124
243 | 39318,179,892
244 | 39503,3880,200
245 | 39636,131,1410
246 | 40406,23,1436
247 | 40972,261,108
248 | 41353,135,965
249 | 41400,3684,1150
250 | 41453,151,1645
251 | 41569,7510,182
252 | 41668,1488,823
253 | 41681,369,1001
254 | 41763,3318,1115
255 | 41833,2099,569
256 | 41859,570,1450
257 | 41929,1810,1504
258 | 42087,872,422
259 | 42331,2782,952
260 | 42537,338,1218
261 | 42640,2264,95
262 | 42760,296,829
263 | 42939,4827,1215
264 | 43029,12283,520
265 | 43358,2603,26
266 | 43375,1187,654
267 | 43572,4611,461
268 | 43624,6979,969
269 | 43626,1298,359
270 | 43681,2518,1255
271 | 43933,223,1554
272 | 44303,504,71
273 | 45174,8,1692
274 | 46131,710,329
275 | 46164,1154,761
276 | 46394,644,512
277 | 46577,95,1040
278 | 46592,1488,1343
279 | 46949,665,1651
280 | 47023,672,1042
281 | 47097,146,100
282 | 47408,61,713
283 | 47702,194,855
284 | 48016,223,834
285 | 48333,1397,1529
286 | 49666,247,1127
287 | 49881,93,1409
288 | 51573,42,320
289 | 51834,1061,1058
290 | 52301,656,1094
291 | 52307,205,987
292 | 52662,56,1162
293 | 53131,74,630
294 | 53177,39,781
295 | 55450,274,183
296 | 55798,24,1566
297 | 56458,291,1106
298 | 57616,122,199
299 | 58855,286,228
300 | 62089,390,1636
301 | 67152,24,1477
302 | 69031,11,610
303 | 72844,667,131
304 | 76887,239,1296
305 | 77006,773,1429
306 | 77354,412,909
307 | 79435,25,169
308 | 80342,1765,122
309 | 82188,51,763
310 | 83393,95,627
311 | 83429,72,1306
312 | 86489,1020,501
313 | 87458,262,1530
314 | 87675,436,1426
315 | 88110,2958,441
316 | 88922,89,628
317 | 89049,1250,1117
318 | 90932,376,12
319 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-2.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,8715,1427
3 | 29,35,1479
4 | 104,178,1298
5 | 133,43,1437
6 | 226,69,1482
7 | 323,31,1451
8 | 420,22,1217
9 | 511,34,1491
10 | 601,44,1487
11 | 690,39,1532
12 | 783,23,1231
13 | 884,17,1198
14 | 1051,29,1454
15 | 1143,71,1439
16 | 1227,14,1352
17 | 1308,42,1534
18 | 1567,26,1254
19 | 1657,12,1291
20 | 1751,72,1442
21 | 1882,22,1452
22 | 1929,21,1197
23 | 2025,43,1489
24 | 2105,31,1245
25 | 2193,52,1446
26 | 2277,56,1440
27 | 2390,13,1344
28 | 2447,29,1272
29 | 2616,247,1239
30 | 2699,27,1223
31 | 2794,15,1293
32 | 2874,25,1542
33 | 2958,91,1462
34 | 3035,17,1234
35 | 3121,18,1237
36 | 3207,58,1438
37 | 3463,34,1287
38 | 3553,25,1316
39 | 3648,46,1453
40 | 3720,33,1182
41 | 3802,29,1243
42 | 3885,156,1443
43 | 3973,37,1533
44 | 4054,130,1256
45 | 4142,38,1513
46 | 4222,32,1478
47 | 4314,20,1334
48 | 4389,39,1227
49 | 4476,26,1233
50 | 4548,28,1278
51 | 4633,45,1539
52 | 79480,612,1139
53 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-3.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,6936,384
3 | 62,1673,664
4 | 84,883,1202
5 | 95,4195,258
6 | 97,1996,313
7 | 108,3937,541
8 | 159,6994,321
9 | 180,12143,232
10 | 186,583,428
11 | 256,2709,496
12 | 259,362,863
13 | 367,3103,165
14 | 433,3493,1205
15 | 488,17445,211
16 | 1324,88,91
17 | 1512,2282,799
18 | 3991,294,1112
19 | 5181,855,276
20 | 6222,16694,677
21 | 6242,82,778
22 | 6256,209,618
23 | 8357,7032,328
24 | 8370,2991,634
25 | 8396,4736,1178
26 | 8478,13,1663
27 | 8907,3735,27
28 | 8910,3432,93
29 | 9175,13149,17
30 | 9714,92,424
31 | 10524,5380,97
32 | 11272,194,300
33 | 11919,236,827
34 | 12868,2343,278
35 | 13230,138,1050
36 | 13689,26,289
37 | 14201,1071,497
38 | 14499,448,756
39 | 15020,53798,227
40 | 15089,3695,179
41 | 15137,344,1307
42 | 15182,4485,849
43 | 15199,131,877
44 | 15209,1098,587
45 | 15257,1237,672
46 | 15268,804,51
47 | 15305,424,248
48 | 15356,228,1003
49 | 15370,870,600
50 | 15715,5594,235
51 | 15979,109,25
52 | 16177,1239,163
53 | 16255,821,795
54 | 17977,2183,1068
55 | 18076,254,925
56 | 18477,1837,407
57 | 18681,429,435
58 | 19412,783,659
59 | 19446,202,1578
60 | 19873,165,746
61 | 23243,480,1345
62 | 23744,622,1261
63 | 29980,1279,733
64 | 30818,3830,287
65 | 30944,1605,322
66 | 31566,644,403
67 | 32180,143,192
68 | 32594,234,1038
69 | 32903,4884,584
70 | 33743,955,7
71 | 36573,481,177
72 | 39991,477,943
73 | 40152,1012,1269
74 | 77596,112,1428
75 | 87115,257,1102
76 | 89787,1690,356
77 | 161809,3364,1273
78 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-4.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,42464,675
3 | 18,1008,280
4 | 38,34,1348
5 | 68,2333,448
6 | 320,196,1667
7 | 338,48,1458
8 | 356,202,364
9 | 386,346,1557
10 | 514,94,28
11 | 578,2973,92
12 | 819,1279,1226
13 | 1073,7439,182
14 | 1123,661,1125
15 | 1276,136,1502
16 | 1334,1429,1315
17 | 2082,143,859
18 | 2524,349,291
19 | 3195,81,332
20 | 3285,27,777
21 | 3769,12,884
22 | 4591,314,897
23 | 4710,8745,1369
24 | 5898,31,1418
25 | 6343,2051,133
26 | 6795,1201,1382
27 | 7925,26,379
28 | 8599,115,936
29 | 10043,159,1274
30 | 11001,76,1020
31 | 12551,19,771
32 | 13167,231,347
33 | 13590,1005,306
34 | 14610,106,765
35 | 14884,37,1497
36 | 15098,361,1460
37 | 15475,6,1657
38 | 17443,19,689
39 | 17475,4215,184
40 | 17537,1641,579
41 | 18959,4014,683
42 | 19336,48,1455
43 | 22328,32,1643
44 | 24845,2407,1521
45 | 26336,14,1518
46 | 30939,66,1546
47 | 35341,38,400
48 | 40482,1317,556
49 | 44759,262,183
50 | 44781,39,341
51 | 49452,53,954
52 | 49478,1144,563
53 | 53617,11,1059
54 | 53718,158,1456
55 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-5.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,23008,215
3 | 39,1730,720
4 | 205,677,329
5 | 276,2103,1156
6 | 321,293,1268
7 | 373,9136,286
8 | 397,261,150
9 | 520,1875,86
10 | 950,14848,1074
11 | 991,1464,1343
12 | 1010,783,592
13 | 1384,4769,1206
14 | 1590,53,1496
15 | 1859,584,1149
16 | 1924,4221,344
17 | 2016,461,1621
18 | 2665,1539,963
19 | 3616,371,1331
20 | 3918,543,1275
21 | 4537,1592,564
22 | 4719,348,213
23 | 4982,5741,1561
24 | 5557,1737,1134
25 | 7496,12159,50
26 | 8478,325,447
27 | 8558,51064,43
28 | 8596,18349,190
29 | 8608,1336,163
30 | 8616,2098,838
31 | 8633,244,347
32 | 8706,723,11
33 | 8829,2749,52
34 | 9024,1059,67
35 | 9130,184,340
36 | 11098,299,1463
37 | 11140,903,704
38 | 11319,2629,102
39 | 11868,70,591
40 | 12027,885,454
41 | 13136,295,256
42 | 14302,403,1347
43 | 15296,115,1512
44 | 15973,1725,705
45 | 16443,317,830
46 | 20548,741,390
47 | 28202,23014,215
48 | 28289,7638,261
49 | 28412,448,597
50 | 28416,559,665
51 | 28745,1396,740
52 | 30358,2256,1297
53 | 30379,1152,222
54 | 30582,1627,1214
55 | 30700,5,1687
56 | 30763,42,1063
57 | 30974,314,583
58 | 31004,305,196
59 | 31352,103,1321
60 | 32700,1900,229
61 | 34703,214,1209
62 | 34989,1061,311
63 | 37165,448,23
64 | 37197,3365,1118
65 | 37214,4578,461
66 | 38158,1755,513
67 | 40783,101,1387
68 | 41937,950,1235
69 | 70426,1205,563
70 | 70931,246,63
71 | 92008,2901,1527
72 | 95934,9478,905
73 | 97740,10928,681
74 | 106165,3164,968
75 | 106279,2296,638
76 | 111531,260,1092
77 | 112054,1268,1161
78 | 154562,1718,1267
79 | 155363,32,1633
80 | 158939,885,1511
81 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-6.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,2752,1061
3 | 16,6109,731
4 | 32,705,885
5 | 338,4511,1005
6 | 521,97,1290
7 | 847,1210,682
8 | 3323,505,1376
9 | 6084,4266,613
10 | 6541,1027,1282
11 | 7106,11857,302
12 | 7258,719,588
13 | 7628,1038,1043
14 | 7685,254,1616
15 | 7813,14792,1074
16 | 7854,740,901
17 | 7909,158,999
18 | 7930,1388,475
19 | 8003,4886,1129
20 | 8453,653,114
21 | 8680,893,0
22 | 9061,1357,1049
23 | 11037,166,1071
24 | 11823,705,540
25 | 12972,384,336
26 | 13117,1528,712
27 | 22056,366,1238
28 | 22548,794,1358
29 | 23122,3122,64
30 | 25883,369,1001
31 | 32520,2360,346
32 | 32691,1944,252
33 | 32810,8822,811
34 | 33302,2668,382
35 | 34162,82182,249
36 | 34339,185,1522
37 | 34622,123,1310
38 | 34700,37,1379
39 | 35872,412,427
40 | 36190,159,919
41 | 36522,713,655
42 | 36931,367,392
43 | 37561,1043,260
44 | 38485,18,1403
45 | 38591,66,1242
46 | 39455,4342,499
47 | 39655,313,736
48 | 39763,922,1110
49 | 40024,4155,1123
50 | 40692,1444,1343
51 | 41313,136,129
52 | 41708,4112,1000
53 | 42237,626,1650
54 | 42746,648,472
55 | 43921,1061,1271
56 | 45139,1760,837
57 | 45174,546,1524
58 | 45308,659,1192
59 | 45730,19449,514
60 | 45843,3241,185
61 | 46503,2275,126
62 | 47061,1922,1265
63 | 47888,102,1483
64 | 48933,6607,985
65 | 49203,211,1154
66 | 49219,288,1463
67 | 49617,1876,1041
68 | 50118,322,692
69 | 50173,2155,678
70 | 50973,1705,266
71 | 52042,1707,1034
72 | 52243,724,603
73 | 53694,1661,1221
74 | 53705,1603,710
75 | 55425,1586,564
76 | 58602,76,1555
77 | 68471,1541,35
78 | 71007,185,1098
79 | 74012,249,825
80 | 74224,141,1565
81 | 75937,814,1128
82 | 76638,573,1391
83 | 76683,82,1085
84 | 77431,961,408
85 | 78266,492,650
86 | 78465,259,1530
87 | 78692,1857,1411
88 | 82201,4047,370
89 | 82412,4804,1215
90 | 84349,635,233
91 | 85126,1047,191
92 | 85181,3713,432
93 | 85211,25031,608
94 | 85661,754,506
95 | 85883,1857,854
96 | 86903,519,1523
97 | 87234,3248,769
98 | 87573,457,716
99 | 87718,718,1631
100 | 87784,1175,36
101 | 90254,1206,1131
102 | 90507,537,508
103 | 90529,563,819
104 | 90659,1,1683
105 | 90673,63,479
106 | 91925,3576,515
107 | 92311,779,1476
108 | 93240,645,760
109 | 94475,2546,547
110 | 101538,442,1079
111 | 109939,676,828
112 | 117049,3308,911
113 | 128610,74,576
114 | 134623,3155,1378
115 | 134993,1283,1008
116 | 135761,915,381
117 | 139375,298,593
118 | 149124,178,340
119 | 150659,1404,691
120 | 168372,50,1541
121 | 228277,1614,399
122 | 229138,861,1163
123 | 248224,1308,1302
124 | 248842,1946,378
125 | 251502,1808,466
126 | 251598,1139,585
127 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-7.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,120735,138
3 | 70,401,453
4 | 114,1344,163
5 | 124,1989,156
6 | 128,73,275
7 | 172,2318,941
8 | 191,114,315
9 | 221,1596,351
10 | 237,11926,933
11 | 246,125,31
12 | 299,398,865
13 | 415,1526,1467
14 | 454,1508,1
15 | 472,44,167
16 | 539,99,971
17 | 545,5300,104
18 | 610,24,1174
19 | 636,31,107
20 | 650,1215,708
21 | 652,2178,135
22 | 819,354,1626
23 | 931,143,619
24 | 946,222,1474
25 | 950,3125,270
26 | 1034,289,153
27 | 1087,1823,1248
28 | 1306,816,575
29 | 1436,334,528
30 | 1568,6,1076
31 | 1607,52,1012
32 | 1704,1666,1036
33 | 1704,3890,517
34 | 1998,1673,37
35 | 2087,81,1160
36 | 2224,958,106
37 | 2412,8315,438
38 | 2412,4227,702
39 | 2507,1753,946
40 | 2595,274,208
41 | 2650,2331,1153
42 | 2717,353,846
43 | 2768,83,1484
44 | 2843,1883,842
45 | 2874,1135,69
46 | 3015,1469,394
47 | 3101,7891,195
48 | 3168,2643,267
49 | 3270,81,480
50 | 3406,4313,1169
51 | 3425,1748,1047
52 | 3538,472,220
53 | 3554,4626,602
54 | 3752,2340,784
55 | 3836,379,85
56 | 3896,143,1405
57 | 3905,1660,750
58 | 4143,961,70
59 | 4217,226,964
60 | 4266,965,408
61 | 4375,1097,402
62 | 4385,1713,995
63 | 4389,185,139
64 | 4434,188,1538
65 | 4922,55,481
66 | 5150,34,1067
67 | 5178,192,294
68 | 5353,41,207
69 | 5565,27,376
70 | 5967,703,49
71 | 6532,409,334
72 | 6659,668,236
73 | 7029,1214,357
74 | 7062,308,162
75 | 7405,97,966
76 | 7614,54,1353
77 | 7804,14,718
78 | 7815,1842,1080
79 | 7875,203,1122
80 | 7969,682,633
81 | 8338,438,516
82 | 8428,547,154
83 | 8537,29,1053
84 | 8733,4188,476
85 | 9297,633,931
86 | 9333,50,1111
87 | 9372,1728,266
88 | 9440,68,15
89 | 9513,4128,134
90 | 9685,18,1662
91 | 9845,86,544
92 | 9926,53,1576
93 | 10168,224,436
94 | 11136,2791,976
95 | 11465,40,146
96 | 12011,639,888
97 | 12330,40,1689
98 | 12359,40,1689
99 | 12888,1012,420
100 | 16228,1231,214
101 | 16809,1103,181
102 | 18179,1623,1214
103 | 19134,189,841
104 | 19718,51,537
105 | 20709,1432,137
106 | 21663,2484,578
107 | 22028,591,140
108 | 24039,3238,1312
109 | 24043,2215,709
110 | 24396,1540,649
111 | 25556,14850,1074
112 | 25734,102,1181
113 | 25995,408,160
114 | 26101,1733,724
115 | 26225,1468,48
116 | 26866,179,128
117 | 26934,216,188
118 | 27527,185,822
119 | 28456,203,460
120 | 30332,1483,972
121 | 30658,25,1143
122 | 31066,211,687
123 | 32283,556,1144
124 | 33872,124,94
125 | 34244,912,605
126 | 34291,50,1556
127 | 35044,1537,259
128 | 36211,1943,1032
129 | 37109,1221,240
130 | 39054,94,917
131 | 43003,549,309
132 | 50208,50,355
133 | 54241,164,957
134 | 65698,2297,1520
135 | 89079,44,1673
136 | 185406,33,201
137 | 219472,493,116
138 | 264236,22021,132
139 | 389181,1374,556
140 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-8.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,9361,224
3 | 475,244,369
4 | 1737,536,568
5 | 3412,211,874
6 | 4078,7815,450
7 | 4481,23513,290
8 | 4692,190,1026
9 | 5049,182,1375
10 | 5393,4472,180
11 | 5902,674,729
12 | 6250,1592,397
13 | 6276,86,614
14 | 7001,106,1531
15 | 7394,1861,629
16 | 7805,838,510
17 | 8314,105,1325
18 | 9436,40,1577
19 | 10816,273,887
20 | 11503,408,159
21 | 12272,481,1337
22 | 13253,4128,202
23 | 13425,571,413
24 | 13425,4128,202
25 | 14880,294,430
26 | 16905,3505,456
27 | 17635,1396,187
28 | 18097,26,826
29 | 19248,246,930
30 | 19582,784,1415
31 | 20450,1698,1317
32 | 20876,479,642
33 | 24047,563,612
34 | 24247,4419,141
35 | 24367,80,1558
36 | 25613,106,902
37 | 26527,1154,521
38 | 26625,43,1399
39 | 29764,889,949
40 | 30544,78,601
41 | 34821,500,958
42 | 35759,74,1113
43 | 40037,39,1659
44 | 41187,545,1057
45 | 43948,329,1361
46 | 51614,262,1029
47 | 52038,2479,1088
48 | 55787,1051,1186
49 | 58420,313,1548
50 | 60883,868,437
51 | 84164,229,431
52 | 86942,1112,558
53 | 88034,458,417
54 | 89174,547,566
55 | 91051,153,1536
56 | 92642,292,676
57 | 101721,1312,1137
58 | 110287,90,1473
59 | 136096,7553,389
60 | 136254,9008,317
61 | 168656,151,1309
62 | 187527,65,1191
63 | 232690,158,1030
64 |
--------------------------------------------------------------------------------
/data/SMH/SMH-cascade-9.csv:
--------------------------------------------------------------------------------
1 | time,magnitude,user_id
2 | 0,2653,604
3 | 182,725,1141
4 | 923,427,1252
5 | 1250,4729,53
6 | 5548,4439,1189
7 | 5596,2420,831
8 | 14859,3708,1262
9 | 14947,1803,814
10 | 15116,1833,1060
11 | 15290,705,205
12 | 15631,2070,928
13 | 17183,11,1672
14 | 21592,1550,561
15 | 21645,2192,491
16 | 21894,594,1355
17 | 24833,917,1266
18 | 24862,3642,393
19 | 25091,56,817
20 | 25352,10409,557
21 | 25504,3984,1070
22 | 25668,4260,805
23 | 25741,2505,1019
24 | 25743,4187,1447
25 | 25917,1398,1343
26 | 26592,995,194
27 | 26723,442,735
28 | 26994,1230,851
29 | 27224,1522,555
30 | 27277,1831,1041
31 | 27347,1236,794
32 | 27572,377,1619
33 | 28817,1379,8
34 | 28820,272,970
35 | 29620,735,506
36 | 29874,7886,354
37 | 30964,19306,514
38 | 33048,95,1289
39 | 33216,3505,743
40 | 33951,204,251
41 | 36340,1227,937
42 | 36489,59,1416
43 | 36734,124,1507
44 | 36788,3554,1150
45 | 37728,630,913
46 | 38390,284,626
47 | 38503,2251,1004
48 | 38743,294,1519
49 | 39442,217,644
50 | 41620,4595,844
51 | 42793,182,1445
52 | 47523,42,155
53 | 47968,538,508
54 | 53950,2288,530
55 | 54058,3112,1406
56 | 55730,1177,350
57 | 55791,1505,1648
58 | 55823,4193,613
59 | 58648,1440,869
60 | 61707,3071,64
61 | 67597,462,775
62 | 76315,1804,466
63 | 76849,741,810
64 | 79013,936,916
65 | 79206,165,297
66 | 84711,773,1359
67 | 85784,186,1136
68 | 85828,2259,1200
69 | 86771,2886,701
70 | 86796,2202,1195
71 | 86911,4971,1449
72 | 87093,3231,185
73 | 87210,628,1276
74 | 87657,1584,366
75 | 92116,516718,136
76 | 92188,17,1403
77 | 92243,154,876
78 | 92318,291,598
79 | 92356,151,246
80 | 92370,63,1465
81 | 93020,798,29
82 | 93617,219,894
83 | 93714,1013,343
84 | 94631,184,1333
85 | 94769,83,900
86 | 95596,2457,112
87 | 95723,3652,567
88 | 96119,1359,910
89 | 96613,129,1495
90 | 96869,1042,34
91 | 97092,4872,584
92 | 97694,3,1678
93 | 98041,1281,371
94 | 98101,3724,839
95 | 99990,25,1219
96 | 103660,696,984
97 | 103684,8733,811
98 | 104220,3735,1145
99 | 105771,17,1675
100 | 116256,314,774
101 | 125479,777,1104
102 | 158038,1174,1130
103 | 188078,117,305
104 | 561223,2783,1527
105 | 561403,2226,1119
106 | 563177,492,176
107 | 563197,1423,1343
108 |
--------------------------------------------------------------------------------
/data/hashtags-political-bias.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/computationalmedia/cascade-influence/fa437415af378f0936198c55a6d0bbc049234835/data/hashtags-political-bias.xlsx
--------------------------------------------------------------------------------
/scripts/__init__.py:
--------------------------------------------------------------------------------
1 | __all__ = ["casIn"]
--------------------------------------------------------------------------------
/scripts/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/computationalmedia/cascade-influence/fa437415af378f0936198c55a6d0bbc049234835/scripts/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/scripts/__pycache__/influence.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/computationalmedia/cascade-influence/fa437415af378f0936198c55a6d0bbc049234835/scripts/__pycache__/influence.cpython-36.pyc
--------------------------------------------------------------------------------
/scripts/__pycache__/user_influence.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/computationalmedia/cascade-influence/fa437415af378f0936198c55a6d0bbc049234835/scripts/__pycache__/user_influence.cpython-36.pyc
--------------------------------------------------------------------------------
/scripts/casIn/__init__.py:
--------------------------------------------------------------------------------
1 | __all__ = ["user_influence"]
2 |
--------------------------------------------------------------------------------
/scripts/casIn/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/computationalmedia/cascade-influence/fa437415af378f0936198c55a6d0bbc049234835/scripts/casIn/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/scripts/casIn/__pycache__/user_influence.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/computationalmedia/cascade-influence/fa437415af378f0936198c55a6d0bbc049234835/scripts/casIn/__pycache__/user_influence.cpython-36.pyc
--------------------------------------------------------------------------------
/scripts/casIn/user_influence.py:
--------------------------------------------------------------------------------
1 | from functools import reduce
2 | import pandas as pd
3 | import numpy as np
4 |
5 | def casIn(cascade_path, time_decay):
6 | """
7 | compute influence in one cascade
8 | """
9 |
10 | cascade = pd.read_csv(cascade_path) # Read one cascade from local file
11 | p_ij = P(cascade, r=time_decay) # compute p_ij in given cascade
12 | inf, m_ij = influence(p_ij) # compute user influence
13 | cascade["influence"] = pd.Series(inf)
14 | return cascade
15 |
16 |
17 | def P(cascade,r = -0.000068):
18 | """
19 | this function compute the maritx P of a cascade
20 | """
21 |
22 | n = len(cascade)
23 | t = np.zeros(n,dtype = np.float64)
24 | f = np.zeros(n,dtype = np.float64)
25 | p = np.zeros((n,n),dtype = np.float64)
26 | norm = np.zeros(n,dtype = np.float64)
27 | for k, row in cascade.iterrows():
28 | if k == 0:
29 | p[0][0] = 1
30 | t[0] = row['time']
31 | f[0] = 1 if row['magnitude'] == 0 else row['magnitude']
32 | continue
33 |
34 | t[k] = row['time']
35 | f[k] = 1 if row['magnitude'] == 0 else row['magnitude']
36 | p[:k, k] = ((r * (t[k] - t[0:k])) + np.log(f[0:k])) # store the P_ji in log space
37 | norm[k] = reduce(np.logaddexp, p[:k, k])
38 | p[:k, k] = np.exp(p[:k, k] - norm[k])# recover the P_ji from log space
39 |
40 | return p
41 |
42 |
43 | def influence(p):
44 |
45 | """Estimate user influence
46 | This function compute the user influence and store
47 | it in matirx m_ij
48 | """
49 | n = len(p)
50 | m = np.zeros((n, n))
51 | m[0, 0] = 1
52 | for i in range(0, n-1):
53 | vec = p[:i+1, i+1]
54 | m[:i+1, i+1] = m[:i+1, :i+1]@vec
55 | m[i+1, i+1] = 1
56 | influence = np.sum(m, axis = 1)
57 |
58 | return influence, m
59 |
60 |
--------------------------------------------------------------------------------
/scripts/influence.py:
--------------------------------------------------------------------------------
1 | from casIn.user_influence import casIn
2 | import argparse
3 |
4 | parser = argparse.ArgumentParser(description='casIn')
5 | parser.add_argument('--cascade_path', type=str)
6 | parser.add_argument('--time_decay', type=float, default=-0.000068)
7 | parser.add_argument('--save2csv', type=bool, default=False)
8 | args = parser.parse_args()
9 |
10 | if __name__ == '__main__':
11 | influence = casIn(args.cascade_path, args.time_decay)
12 | print(influence)
13 | if args.save2csv:
14 | influence.to_csv("result.csv",header=True, index=False)
--------------------------------------------------------------------------------