-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from ComplexData-MILA/dtdg
Ready for Release
- Loading branch information
Showing
18 changed files
with
1,149 additions
and
1,177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,175 +1,106 @@ | ||
# Welcome to TGX | ||
<!-- # TGX --> | ||
![TGX logo](2023_TGX_logo.png) | ||
|
||
# Temporal Graph Analysis with TGX (WSDM 2024 Demo Track) | ||
<h4> | ||
<a href="https://arxiv.org/abs/2402.03651"><img src="https://img.shields.io/badge/arXiv-pdf-yellowgreen"></a> | ||
<a href="https://complexdata-mila.github.io/TGX/"><img src="https://img.shields.io/badge/docs-orange"></a> | ||
</h4> | ||
|
||
TGX supports all datasets from [TGB](https://tgb.complexdatalab.com/) and [Poursafaei et al. 2022](https://openreview.net/forum?id=1GVpwr2Tfdg) as well as any custom dataset in `.csv` format. | ||
TGX provides numerous temporal graph visualization plots and statistics out of the box | ||
|
||
### Pip Install | ||
|
||
You can install TGX via [pip](https://pypi.org/project/py-tgb/) | ||
### Data Loading ### | ||
For detailed tutorial on how to load the datasets into `tgx.Graph`, see [`docs/tutorials/data_loader.ipynb`](https://github.com/ComplexData-MILA/TGX/blob/master/docs/tutorials/data_loader.ipynb) | ||
|
||
1. Load TGB datasets | ||
``` | ||
pip install py-tgx | ||
import tgx | ||
dataset = tgx.tgb_data("tgbl-wiki") | ||
ctdg = tgx.Graph(dataset) | ||
``` | ||
|
||
<!-- ### Links and Datasets | ||
<!-- The project website can be found [here](https://tgb.complexdatalab.com/). --> | ||
|
||
<!-- The API documentations can be found [here](https://shenyanghuang.github.io/TGB/). --> | ||
|
||
<!-- all dataset download links can be found at [info.py](https://github.com/shenyangHuang/TGB/blob/main/tgb/utils/info.py) | ||
TGB dataloader will also automatically download the dataset as well as the negative samples for the link property prediction datasets. --> | ||
|
||
|
||
<!-- ### Install dependency --> | ||
### Install dependency | ||
Our implementation works with python >= 3.9 and can be installed as follows | ||
|
||
1. set up virtual environment (conda should work as well) | ||
2. Load built-in datasets | ||
``` | ||
python -m venv ~/tgx_env/ | ||
source ~/tgx_env/bin/activate | ||
dataset = tgx.builtin.uci() | ||
ctdg = tgx.Graph(dataset) | ||
``` | ||
|
||
2. install external packages | ||
3. Load custom datasets from `.csv` | ||
``` | ||
pip install -r requirements.txt | ||
from tgx.io.read import read_csv | ||
toy_fname = "docs/tutorials/toy_data.csv" | ||
edgelist = read_csv(toy_fname, header=True,index=False, t_col=0,) | ||
tgx.Graph(edgelist=edgelist) | ||
``` | ||
|
||
### Visualization and Statistics ### | ||
For detailed tutorial on how to generate visualizations and compute statistics for temporal graphs, see [`docs/tutorials/data_viz_stats.ipynb`](https://github.com/ComplexData-MILA/TGX/blob/master/docs/tutorials/data_viz_stats.ipynb) | ||
|
||
1. Discretize the network (required for viz) | ||
|
||
3. install local dependencies under root directory `/TGX` | ||
``` | ||
pip install -e py-tgx | ||
dataset = tgx.builtin.uci() | ||
ctdg = tgx.Graph(dataset) | ||
time_scale = "weekly" | ||
dtdg, ts_list = ctdg.discretize(time_scale=time_scale, store_unix=True) | ||
``` | ||
|
||
2. Plot the number of nodes over time | ||
|
||
<!-- ### Instruction for tracking new documentation and running mkdocs locally | ||
1. first run the mkdocs server locally in your terminal | ||
``` | ||
mkdocs serve | ||
tgx.degree_over_time(dtdg, network_name="uci") | ||
``` | ||
|
||
2. go to the local hosted web address similar to | ||
3. Compute novelty index | ||
``` | ||
[14:18:13] Browser connected: http://127.0.0.1:8000/ | ||
``` --> | ||
|
||
<!-- Example: to track documentation of a new hi.py file in tgb/edgeregression/hi.py --> | ||
|
||
|
||
<!-- 3. create docs/api/tgb.hi.md and add the following | ||
tgx.get_novelty(dtdg) | ||
``` | ||
# `tgb.edgeregression` | ||
|
||
::: tgb.edgeregression.hi | ||
``` --> | ||
|
||
<!-- 4. edit mkdocs.yml | ||
``` | ||
nav: | ||
- Overview: index.md | ||
- About: about.md | ||
- API: | ||
other *.md files | ||
- tgb.edgeregression: api/tgb.hi.md | ||
``` --> | ||
### Install dependency | ||
Our implementation works with python >= 3.9 and can be installed as follows | ||
|
||
### Creating new branch ### | ||
1. set up virtual environment (conda should work as well) | ||
``` | ||
git fetch origin | ||
git checkout -b test origin/test | ||
python -m venv ~/tgx_env/ | ||
source ~/tgx_env/bin/activate | ||
``` | ||
|
||
### dependencies for mkdocs (documentation) | ||
2. install external packages | ||
``` | ||
pip install mkdocs | ||
pip install mkdocs-material | ||
pip install mkdocstrings-python | ||
pip install mkdocs-jupyter | ||
pip install notebook | ||
pip install mkdocs-glightbox | ||
pip install -r requirements.txt | ||
``` | ||
|
||
|
||
### full dependency list | ||
Our implementation works with python >= 3.9 and has the following dependencies | ||
3. install local dependencies under root directory `/TGX` | ||
<!-- ``` | ||
pip install -e py-tgx | ||
``` --> | ||
``` | ||
matplotlib==3.8.0 | ||
pandas==2.1.1 | ||
numpy==1.26.0 | ||
seaborn==0.13.0 | ||
tqdm==4.66.1 | ||
scikit-learn==1.3.1 | ||
tgb==0.9.0 | ||
pip install -e . | ||
``` | ||
|
||
|
||
|
||
<!-- ## Code blocks | ||
`pip install tgb` --> | ||
|
||
|
||
|
||
<!-- | ||
### Plain codeblock | ||
A plain codeblock: | ||
3. [alternatively] install from test-pypi | ||
|
||
``` | ||
Some code here | ||
def myfunction() | ||
// some comment | ||
pip install -i https://test.pypi.org/simple/ py-tgx | ||
``` | ||
You can specify the version with `==`, note that the pypi version might not always be the most updated version | ||
|
||
#### Code for a specific language | ||
|
||
Some more code with the `py` at the start: | ||
``` py | ||
import tensorflow as tf | ||
def whatever() | ||
4. [optional] install mkdocs dependencies to serve the documentation locally | ||
``` | ||
#### With a title | ||
``` py title="bubble_sort.py" | ||
def bubble_sort(items): | ||
for i in range(len(items)): | ||
for j in range(len(items) - 1 - i): | ||
if items[j] > items[j + 1]: | ||
items[j], items[j + 1] = items[j + 1], items[j] | ||
pip install mkdocs-glightbox | ||
``` | ||
|
||
#### With line numbers | ||
### Creating new branch ### | ||
|
||
``` py linenums="1" | ||
def bubble_sort(items): | ||
for i in range(len(items)): | ||
for j in range(len(items) - 1 - i): | ||
if items[j] > items[j + 1]: | ||
items[j], items[j + 1] = items[j + 1], items[j] | ||
first create the branch on github | ||
``` | ||
git fetch origin | ||
#### Highlighting lines | ||
``` py hl_lines="2 3" | ||
def bubble_sort(items): | ||
for i in range(len(items)): | ||
for j in range(len(items) - 1 - i): | ||
if items[j] > items[j + 1]: | ||
items[j], items[j + 1] = items[j + 1], items[j] | ||
git checkout -b test origin/test | ||
``` | ||
## Icons and Emojs | ||
:smile: | ||
:fontawesome-regular-face-laugh-wink: | ||
:fontawesome-brands-twitter:{ .twitter } | ||
:octicons-heart-fill-24:{ .heart } --> |
Oops, something went wrong.