You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
847 lines
30 KiB
Plaintext
847 lines
30 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"%load_ext autoreload\n",
|
|
"%autoreload 2\n",
|
|
"\n",
|
|
"import os\n",
|
|
"import wget\n",
|
|
"import zipfile\n",
|
|
"import numpy as np\n",
|
|
"import pandas as pd\n",
|
|
"import networkx as nx\n",
|
|
"import plotly.graph_objects as go\n",
|
|
"# from utils import *\n",
|
|
"from collections import Counter\n",
|
|
"from tqdm import tqdm\n",
|
|
"import time\n",
|
|
"import geopandas as gpd\n",
|
|
"import gdown # for downloading files from google drive\n",
|
|
"import shutil\n",
|
|
"# ignore warnings\n",
|
|
"import warnings\n",
|
|
"import sys\n",
|
|
"warnings.filterwarnings(\"ignore\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>Graph</th>\n",
|
|
" <th>Number of Nodes</th>\n",
|
|
" <th>Number of Edges</th>\n",
|
|
" <th>Average Degree</th>\n",
|
|
" <th>Average Clustering Coefficient</th>\n",
|
|
" <th>log N</th>\n",
|
|
" <th>Average Shortest Path Length</th>\n",
|
|
" <th>betweenness centrality</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>Brightkite Checkins Graph</td>\n",
|
|
" <td>6493</td>\n",
|
|
" <td>292973</td>\n",
|
|
" <td>90.242723</td>\n",
|
|
" <td>0.713999</td>\n",
|
|
" <td>8.778480</td>\n",
|
|
" <td>3.013369</td>\n",
|
|
" <td>0.000534</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>Gowalla Checkins Graph</td>\n",
|
|
" <td>3073</td>\n",
|
|
" <td>62790</td>\n",
|
|
" <td>40.865604</td>\n",
|
|
" <td>0.548372</td>\n",
|
|
" <td>8.030410</td>\n",
|
|
" <td>3.508031</td>\n",
|
|
" <td>0.001277</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>Foursquare Checkins Graph</td>\n",
|
|
" <td>2324</td>\n",
|
|
" <td>246702</td>\n",
|
|
" <td>212.30809</td>\n",
|
|
" <td>0.65273</td>\n",
|
|
" <td>7.751045</td>\n",
|
|
" <td>2.186112</td>\n",
|
|
" <td>0.000938</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>3</th>\n",
|
|
" <td>Brightkite Friendship Graph</td>\n",
|
|
" <td>5420</td>\n",
|
|
" <td>14690</td>\n",
|
|
" <td>5.420664</td>\n",
|
|
" <td>0.218571</td>\n",
|
|
" <td>8.597851</td>\n",
|
|
" <td>5.231807</td>\n",
|
|
" <td>0.000664</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>4</th>\n",
|
|
" <td>(Filtered) Gowalla Friendship Graph</td>\n",
|
|
" <td>2294</td>\n",
|
|
" <td>5548</td>\n",
|
|
" <td>4.836966</td>\n",
|
|
" <td>0.234293</td>\n",
|
|
" <td>7.738052</td>\n",
|
|
" <td>5.396488</td>\n",
|
|
" <td>0.001331</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>5</th>\n",
|
|
" <td>Foursquare Friendship Graph</td>\n",
|
|
" <td>1397</td>\n",
|
|
" <td>5323</td>\n",
|
|
" <td>7.620616</td>\n",
|
|
" <td>0.183485</td>\n",
|
|
" <td>7.242082</td>\n",
|
|
" <td>6.45841</td>\n",
|
|
" <td>0.001531</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" Graph Number of Nodes Number of Edges \\\n",
|
|
"0 Brightkite Checkins Graph 6493 292973 \n",
|
|
"1 Gowalla Checkins Graph 3073 62790 \n",
|
|
"2 Foursquare Checkins Graph 2324 246702 \n",
|
|
"3 Brightkite Friendship Graph 5420 14690 \n",
|
|
"4 (Filtered) Gowalla Friendship Graph 2294 5548 \n",
|
|
"5 Foursquare Friendship Graph 1397 5323 \n",
|
|
"\n",
|
|
" Average Degree Average Clustering Coefficient log N \\\n",
|
|
"0 90.242723 0.713999 8.778480 \n",
|
|
"1 40.865604 0.548372 8.030410 \n",
|
|
"2 212.30809 0.65273 7.751045 \n",
|
|
"3 5.420664 0.218571 8.597851 \n",
|
|
"4 4.836966 0.234293 7.738052 \n",
|
|
"5 7.620616 0.183485 7.242082 \n",
|
|
"\n",
|
|
" Average Shortest Path Length betweenness centrality \n",
|
|
"0 3.013369 0.000534 \n",
|
|
"1 3.508031 0.001277 \n",
|
|
"2 2.186112 0.000938 \n",
|
|
"3 5.231807 0.000664 \n",
|
|
"4 5.396488 0.001331 \n",
|
|
"5 6.45841 0.001531 "
|
|
]
|
|
},
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"analysis_results = pd.read_pickle('analysis_results.pkl')\n",
|
|
"analysis_results"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>Graph</th>\n",
|
|
" <th>Number of Nodes</th>\n",
|
|
" <th>Number of Edges</th>\n",
|
|
" <th>Average Degree</th>\n",
|
|
" <th>Average Clustering Coefficient</th>\n",
|
|
" <th>log N</th>\n",
|
|
" <th>Average Shortest Path Length</th>\n",
|
|
" <th>betweenness centrality</th>\n",
|
|
" <th>omega-coefficient</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>Brightkite Checkins Graph</td>\n",
|
|
" <td>6493</td>\n",
|
|
" <td>292973</td>\n",
|
|
" <td>90.242723</td>\n",
|
|
" <td>0.713999</td>\n",
|
|
" <td>8.778480</td>\n",
|
|
" <td>3.013369</td>\n",
|
|
" <td>0.000534</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>Gowalla Checkins Graph</td>\n",
|
|
" <td>3073</td>\n",
|
|
" <td>62790</td>\n",
|
|
" <td>40.865604</td>\n",
|
|
" <td>0.548372</td>\n",
|
|
" <td>8.030410</td>\n",
|
|
" <td>3.508031</td>\n",
|
|
" <td>0.001277</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>Foursquare Checkins Graph</td>\n",
|
|
" <td>2324</td>\n",
|
|
" <td>246702</td>\n",
|
|
" <td>212.30809</td>\n",
|
|
" <td>0.65273</td>\n",
|
|
" <td>7.751045</td>\n",
|
|
" <td>2.186112</td>\n",
|
|
" <td>0.000938</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>3</th>\n",
|
|
" <td>Brightkite Friendship Graph</td>\n",
|
|
" <td>5420</td>\n",
|
|
" <td>14690</td>\n",
|
|
" <td>5.420664</td>\n",
|
|
" <td>0.218571</td>\n",
|
|
" <td>8.597851</td>\n",
|
|
" <td>5.231807</td>\n",
|
|
" <td>0.000664</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>4</th>\n",
|
|
" <td>(Filtered) Gowalla Friendship Graph</td>\n",
|
|
" <td>2294</td>\n",
|
|
" <td>5548</td>\n",
|
|
" <td>4.836966</td>\n",
|
|
" <td>0.234293</td>\n",
|
|
" <td>7.738052</td>\n",
|
|
" <td>5.396488</td>\n",
|
|
" <td>0.001331</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>5</th>\n",
|
|
" <td>Foursquare Friendship Graph</td>\n",
|
|
" <td>1397</td>\n",
|
|
" <td>5323</td>\n",
|
|
" <td>7.620616</td>\n",
|
|
" <td>0.183485</td>\n",
|
|
" <td>7.242082</td>\n",
|
|
" <td>6.45841</td>\n",
|
|
" <td>0.001531</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" Graph Number of Nodes Number of Edges \\\n",
|
|
"0 Brightkite Checkins Graph 6493 292973 \n",
|
|
"1 Gowalla Checkins Graph 3073 62790 \n",
|
|
"2 Foursquare Checkins Graph 2324 246702 \n",
|
|
"3 Brightkite Friendship Graph 5420 14690 \n",
|
|
"4 (Filtered) Gowalla Friendship Graph 2294 5548 \n",
|
|
"5 Foursquare Friendship Graph 1397 5323 \n",
|
|
"\n",
|
|
" Average Degree Average Clustering Coefficient log N \\\n",
|
|
"0 90.242723 0.713999 8.778480 \n",
|
|
"1 40.865604 0.548372 8.030410 \n",
|
|
"2 212.30809 0.65273 7.751045 \n",
|
|
"3 5.420664 0.218571 8.597851 \n",
|
|
"4 4.836966 0.234293 7.738052 \n",
|
|
"5 7.620616 0.183485 7.242082 \n",
|
|
"\n",
|
|
" Average Shortest Path Length betweenness centrality omega-coefficient \n",
|
|
"0 3.013369 0.000534 NaN \n",
|
|
"1 3.508031 0.001277 NaN \n",
|
|
"2 2.186112 0.000938 NaN \n",
|
|
"3 5.231807 0.000664 NaN \n",
|
|
"4 5.396488 0.001331 NaN \n",
|
|
"5 6.45841 0.001531 NaN "
|
|
]
|
|
},
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"analysis_results['omega-coefficient'] = np.nan\n",
|
|
"analysis_results"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>Graph</th>\n",
|
|
" <th>Number of Nodes</th>\n",
|
|
" <th>Number of Edges</th>\n",
|
|
" <th>Average Degree</th>\n",
|
|
" <th>Average Clustering Coefficient</th>\n",
|
|
" <th>log N</th>\n",
|
|
" <th>Average Shortest Path Length</th>\n",
|
|
" <th>betweenness centrality</th>\n",
|
|
" <th>omega-coefficient</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>Brightkite Checkins Graph</td>\n",
|
|
" <td>6493</td>\n",
|
|
" <td>292973</td>\n",
|
|
" <td>90.242723</td>\n",
|
|
" <td>0.713999</td>\n",
|
|
" <td>8.778480</td>\n",
|
|
" <td>3.013369</td>\n",
|
|
" <td>0.000534</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>Gowalla Checkins Graph</td>\n",
|
|
" <td>3073</td>\n",
|
|
" <td>62790</td>\n",
|
|
" <td>40.865604</td>\n",
|
|
" <td>0.548372</td>\n",
|
|
" <td>8.030410</td>\n",
|
|
" <td>3.508031</td>\n",
|
|
" <td>0.001277</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>Foursquare Checkins Graph</td>\n",
|
|
" <td>2324</td>\n",
|
|
" <td>246702</td>\n",
|
|
" <td>212.30809</td>\n",
|
|
" <td>0.65273</td>\n",
|
|
" <td>7.751045</td>\n",
|
|
" <td>2.186112</td>\n",
|
|
" <td>0.000938</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>3</th>\n",
|
|
" <td>Brightkite Friendship Graph</td>\n",
|
|
" <td>5420</td>\n",
|
|
" <td>14690</td>\n",
|
|
" <td>5.420664</td>\n",
|
|
" <td>0.218571</td>\n",
|
|
" <td>8.597851</td>\n",
|
|
" <td>5.231807</td>\n",
|
|
" <td>0.000664</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>4</th>\n",
|
|
" <td>(Filtered) Gowalla Friendship Graph</td>\n",
|
|
" <td>2294</td>\n",
|
|
" <td>5548</td>\n",
|
|
" <td>4.836966</td>\n",
|
|
" <td>0.234293</td>\n",
|
|
" <td>7.738052</td>\n",
|
|
" <td>5.396488</td>\n",
|
|
" <td>0.001331</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>5</th>\n",
|
|
" <td>Foursquare Friendship Graph</td>\n",
|
|
" <td>1397</td>\n",
|
|
" <td>5323</td>\n",
|
|
" <td>7.620616</td>\n",
|
|
" <td>0.183485</td>\n",
|
|
" <td>7.242082</td>\n",
|
|
" <td>6.45841</td>\n",
|
|
" <td>0.001531</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" Graph Number of Nodes Number of Edges \\\n",
|
|
"0 Brightkite Checkins Graph 6493 292973 \n",
|
|
"1 Gowalla Checkins Graph 3073 62790 \n",
|
|
"2 Foursquare Checkins Graph 2324 246702 \n",
|
|
"3 Brightkite Friendship Graph 5420 14690 \n",
|
|
"4 (Filtered) Gowalla Friendship Graph 2294 5548 \n",
|
|
"5 Foursquare Friendship Graph 1397 5323 \n",
|
|
"\n",
|
|
" Average Degree Average Clustering Coefficient log N \\\n",
|
|
"0 90.242723 0.713999 8.778480 \n",
|
|
"1 40.865604 0.548372 8.030410 \n",
|
|
"2 212.30809 0.65273 7.751045 \n",
|
|
"3 5.420664 0.218571 8.597851 \n",
|
|
"4 4.836966 0.234293 7.738052 \n",
|
|
"5 7.620616 0.183485 7.242082 \n",
|
|
"\n",
|
|
" Average Shortest Path Length betweenness centrality omega-coefficient \n",
|
|
"0 3.013369 0.000534 NaN \n",
|
|
"1 3.508031 0.001277 NaN \n",
|
|
"2 2.186112 0.000938 NaN \n",
|
|
"3 5.231807 0.000664 NaN \n",
|
|
"4 5.396488 0.001331 NaN \n",
|
|
"5 6.45841 0.001531 NaN "
|
|
]
|
|
},
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# rename (Filtered) Gowalla Friendship Graph in Gowalla Friendship Graph\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == 'Filtered Gowalla Friendship Graph', 'Graph'] = 'Gowalla Friendship Graph'\n",
|
|
"analysis_results"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 18,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>Graph</th>\n",
|
|
" <th>Number of Nodes</th>\n",
|
|
" <th>Number of Edges</th>\n",
|
|
" <th>Average Degree</th>\n",
|
|
" <th>Average Clustering Coefficient</th>\n",
|
|
" <th>log N</th>\n",
|
|
" <th>Average Shortest Path Length</th>\n",
|
|
" <th>betweenness centrality</th>\n",
|
|
" <th>omega-coefficient</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>Brightkite Checkins Graph</td>\n",
|
|
" <td>6493</td>\n",
|
|
" <td>292973</td>\n",
|
|
" <td>90.242723</td>\n",
|
|
" <td>0.713999</td>\n",
|
|
" <td>8.778480</td>\n",
|
|
" <td>3.013369</td>\n",
|
|
" <td>0.000534</td>\n",
|
|
" <td>-0.180</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>Gowalla Checkins Graph</td>\n",
|
|
" <td>3073</td>\n",
|
|
" <td>62790</td>\n",
|
|
" <td>40.865604</td>\n",
|
|
" <td>0.548372</td>\n",
|
|
" <td>8.030410</td>\n",
|
|
" <td>3.508031</td>\n",
|
|
" <td>0.001277</td>\n",
|
|
" <td>-0.240</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>Foursquare Checkins Graph</td>\n",
|
|
" <td>2324</td>\n",
|
|
" <td>246702</td>\n",
|
|
" <td>212.30809</td>\n",
|
|
" <td>0.65273</td>\n",
|
|
" <td>7.751045</td>\n",
|
|
" <td>2.186112</td>\n",
|
|
" <td>0.000938</td>\n",
|
|
" <td>-0.056</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>3</th>\n",
|
|
" <td>Brightkite Friendship Graph</td>\n",
|
|
" <td>5420</td>\n",
|
|
" <td>14690</td>\n",
|
|
" <td>5.420664</td>\n",
|
|
" <td>0.218571</td>\n",
|
|
" <td>8.597851</td>\n",
|
|
" <td>5.231807</td>\n",
|
|
" <td>0.000664</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>4</th>\n",
|
|
" <td>(Filtered) Gowalla Friendship Graph</td>\n",
|
|
" <td>2294</td>\n",
|
|
" <td>5548</td>\n",
|
|
" <td>4.836966</td>\n",
|
|
" <td>0.234293</td>\n",
|
|
" <td>7.738052</td>\n",
|
|
" <td>5.396488</td>\n",
|
|
" <td>0.001331</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>5</th>\n",
|
|
" <td>Foursquare Friendship Graph</td>\n",
|
|
" <td>1397</td>\n",
|
|
" <td>5323</td>\n",
|
|
" <td>7.620616</td>\n",
|
|
" <td>0.183485</td>\n",
|
|
" <td>7.242082</td>\n",
|
|
" <td>6.45841</td>\n",
|
|
" <td>0.001531</td>\n",
|
|
" <td>NaN</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" Graph Number of Nodes Number of Edges \\\n",
|
|
"0 Brightkite Checkins Graph 6493 292973 \n",
|
|
"1 Gowalla Checkins Graph 3073 62790 \n",
|
|
"2 Foursquare Checkins Graph 2324 246702 \n",
|
|
"3 Brightkite Friendship Graph 5420 14690 \n",
|
|
"4 (Filtered) Gowalla Friendship Graph 2294 5548 \n",
|
|
"5 Foursquare Friendship Graph 1397 5323 \n",
|
|
"\n",
|
|
" Average Degree Average Clustering Coefficient log N \\\n",
|
|
"0 90.242723 0.713999 8.778480 \n",
|
|
"1 40.865604 0.548372 8.030410 \n",
|
|
"2 212.30809 0.65273 7.751045 \n",
|
|
"3 5.420664 0.218571 8.597851 \n",
|
|
"4 4.836966 0.234293 7.738052 \n",
|
|
"5 7.620616 0.183485 7.242082 \n",
|
|
"\n",
|
|
" Average Shortest Path Length betweenness centrality omega-coefficient \n",
|
|
"0 3.013369 0.000534 -0.180 \n",
|
|
"1 3.508031 0.001277 -0.240 \n",
|
|
"2 2.186112 0.000938 -0.056 \n",
|
|
"3 5.231807 0.000664 NaN \n",
|
|
"4 5.396488 0.001331 NaN \n",
|
|
"5 6.45841 0.001531 NaN "
|
|
]
|
|
},
|
|
"execution_count": 18,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Foursquare Checkins Graph : -0.056\n",
|
|
"# Gowalla Checkins Graph : -0.24\n",
|
|
"# Brightkite Checkins Graph : -0.18\n",
|
|
"\n",
|
|
"# add omega-coefficient to the respective graphs\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == 'Foursquare Checkins Graph', 'omega-coefficient'] = -0.056\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == 'Gowalla Checkins Graph', 'omega-coefficient'] = -0.24\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == 'Brightkite Checkins Graph', 'omega-coefficient'] = -0.18\n",
|
|
"analysis_results"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 25,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# rename (Filtered) Gowalla Friendship Graph in Gowalla Friendship Graph\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == '(Filtered) Gowalla Friendship Graph', 'Graph'] = 'Gowalla Friendship Graph'"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 26,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# FourSquare Friendship Graph : -0.17\n",
|
|
"# Gowalla Friendship Graph : -0.25\n",
|
|
"# Brightkite Friendship Graph : -0.20\n",
|
|
"\n",
|
|
"# add omega-coefficient to the respective graphs\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == 'Foursquare Friendship Graph', 'omega-coefficient'] = -0.17\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == 'Gowalla Friendship Graph', 'omega-coefficient'] = -0.25\n",
|
|
"analysis_results.loc[analysis_results['Graph'] == 'Brightkite Friendship Graph', 'omega-coefficient'] = -0.20"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 27,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>Graph</th>\n",
|
|
" <th>Number of Nodes</th>\n",
|
|
" <th>Number of Edges</th>\n",
|
|
" <th>Average Degree</th>\n",
|
|
" <th>Average Clustering Coefficient</th>\n",
|
|
" <th>log N</th>\n",
|
|
" <th>Average Shortest Path Length</th>\n",
|
|
" <th>betweenness centrality</th>\n",
|
|
" <th>omega-coefficient</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>Brightkite Checkins Graph</td>\n",
|
|
" <td>6493</td>\n",
|
|
" <td>292973</td>\n",
|
|
" <td>90.242723</td>\n",
|
|
" <td>0.713999</td>\n",
|
|
" <td>8.778480</td>\n",
|
|
" <td>3.013369</td>\n",
|
|
" <td>0.000534</td>\n",
|
|
" <td>-0.180</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>Gowalla Checkins Graph</td>\n",
|
|
" <td>3073</td>\n",
|
|
" <td>62790</td>\n",
|
|
" <td>40.865604</td>\n",
|
|
" <td>0.548372</td>\n",
|
|
" <td>8.030410</td>\n",
|
|
" <td>3.508031</td>\n",
|
|
" <td>0.001277</td>\n",
|
|
" <td>-0.240</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>Foursquare Checkins Graph</td>\n",
|
|
" <td>2324</td>\n",
|
|
" <td>246702</td>\n",
|
|
" <td>212.30809</td>\n",
|
|
" <td>0.65273</td>\n",
|
|
" <td>7.751045</td>\n",
|
|
" <td>2.186112</td>\n",
|
|
" <td>0.000938</td>\n",
|
|
" <td>-0.056</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>3</th>\n",
|
|
" <td>Brightkite Friendship Graph</td>\n",
|
|
" <td>5420</td>\n",
|
|
" <td>14690</td>\n",
|
|
" <td>5.420664</td>\n",
|
|
" <td>0.218571</td>\n",
|
|
" <td>8.597851</td>\n",
|
|
" <td>5.231807</td>\n",
|
|
" <td>0.000664</td>\n",
|
|
" <td>-0.200</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>4</th>\n",
|
|
" <td>Gowalla Friendship Graph</td>\n",
|
|
" <td>2294</td>\n",
|
|
" <td>5548</td>\n",
|
|
" <td>4.836966</td>\n",
|
|
" <td>0.234293</td>\n",
|
|
" <td>7.738052</td>\n",
|
|
" <td>5.396488</td>\n",
|
|
" <td>0.001331</td>\n",
|
|
" <td>-0.250</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>5</th>\n",
|
|
" <td>Foursquare Friendship Graph</td>\n",
|
|
" <td>1397</td>\n",
|
|
" <td>5323</td>\n",
|
|
" <td>7.620616</td>\n",
|
|
" <td>0.183485</td>\n",
|
|
" <td>7.242082</td>\n",
|
|
" <td>6.45841</td>\n",
|
|
" <td>0.001531</td>\n",
|
|
" <td>-0.170</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" Graph Number of Nodes Number of Edges Average Degree \\\n",
|
|
"0 Brightkite Checkins Graph 6493 292973 90.242723 \n",
|
|
"1 Gowalla Checkins Graph 3073 62790 40.865604 \n",
|
|
"2 Foursquare Checkins Graph 2324 246702 212.30809 \n",
|
|
"3 Brightkite Friendship Graph 5420 14690 5.420664 \n",
|
|
"4 Gowalla Friendship Graph 2294 5548 4.836966 \n",
|
|
"5 Foursquare Friendship Graph 1397 5323 7.620616 \n",
|
|
"\n",
|
|
" Average Clustering Coefficient log N Average Shortest Path Length \\\n",
|
|
"0 0.713999 8.778480 3.013369 \n",
|
|
"1 0.548372 8.030410 3.508031 \n",
|
|
"2 0.65273 7.751045 2.186112 \n",
|
|
"3 0.218571 8.597851 5.231807 \n",
|
|
"4 0.234293 7.738052 5.396488 \n",
|
|
"5 0.183485 7.242082 6.45841 \n",
|
|
"\n",
|
|
" betweenness centrality omega-coefficient \n",
|
|
"0 0.000534 -0.180 \n",
|
|
"1 0.001277 -0.240 \n",
|
|
"2 0.000938 -0.056 \n",
|
|
"3 0.000664 -0.200 \n",
|
|
"4 0.001331 -0.250 \n",
|
|
"5 0.001531 -0.170 "
|
|
]
|
|
},
|
|
"execution_count": 27,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"analysis_results\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# save the results into a pickle file\n",
|
|
"analysis_results.to_pickle('analysis_results.pkl')"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3.10.8 64-bit",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.10.9 (main, Dec 19 2022, 17:35:49) [GCC 12.2.0]"
|
|
},
|
|
"orig_nbformat": 4,
|
|
"vscode": {
|
|
"interpreter": {
|
|
"hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|