{"id":20710442,"url":"https://github.com/mobiletelesystems/coolgraph","last_synced_at":"2025-04-05T13:06:54.094Z","repository":{"id":208599460,"uuid":"722032264","full_name":"MobileTeleSystems/CoolGraph","owner":"MobileTeleSystems","description":"Make GNN easy to start with","archived":false,"fork":false,"pushed_at":"2025-02-20T11:05:06.000Z","size":24716,"stargazers_count":131,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T12:09:25.733Z","etag":null,"topics":["embbedings","gnn","graph","graph-algorithms","graph-neural-networks","graphconv","graphembedding","graphs","mlflow","optuna","torchgeometric"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MobileTeleSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-22T09:44:16.000Z","updated_at":"2025-03-28T06:17:09.000Z","dependencies_parsed_at":"2024-04-12T14:43:46.384Z","dependency_job_id":"e835a6f1-9695-4ef8-b046-d18a78bfe9fe","html_url":"https://github.com/MobileTeleSystems/CoolGraph","commit_stats":null,"previous_names":["mobiletelesystems/coolgraph"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2FCoolGraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2FCoolGraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2FCoolGraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2FCoolGraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MobileTeleSystems","download_url":"https://codeload.github.com/MobileTeleSystems/CoolGraph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embbedings","gnn","graph","graph-algorithms","graph-neural-networks","graphconv","graphembedding","graphs","mlflow","optuna","torchgeometric"],"created_at":"2024-11-17T02:11:59.434Z","updated_at":"2025-04-05T13:06:54.075Z","avatar_url":"https://github.com/MobileTeleSystems.png","language":"Jupyter Notebook","readme":"CoolGraph is an easy-to-use Python library using Graph Neural Networks for node classification. The CoolGraph contains several architectures that will help you train a network using two lines of code.\n\nThus, the parameters for training have already been selected and collected in configs, but you can change them as you wish.\n\nAlso, if for some reason the selected parameters do not ok for you, it is possible to use the search for hyperparameters with Optuna.\n\nMoreover, your experiments can be saved in Mlflow and fully tracked.\n\nAll you need is graph-structured data.\n\n# Main advantages of CoolGraph:\n - quick start in one line of code\n - good quality of base models, comparable to state of the art\n - the best model architecture automatic search via optuna\n - heterogeneous graph support\n - multitarget support\n - both node and edge features support\n - categorical and graph feaures usage\n - tracking experiments with mlflow\n\n \n# Benchmarks\n\n| *Dataset*            | *Main Metric* | *Train* | *Valid* | *Test*  | *Runner Score* | *HypeRunner Score* | *SOTA* | *Rank* |\n|----------------------|---------------|---------|---------|---------|----------------|--------------------|--------|--------|\n| **Amazon Computers** | accuracy      | 0.6     | 0.2     | 0.2     | 0.918          | 0.915              | 0.939  | 3      |\n| **Amazon Photo**     | accuracy      | 0.6     | 0.2     | 0.2     | 0.959          | 0.961              | 0.967  | 3      |\n| **Amzon-Fraud**      | roc-auc       | 0.4     | 0.2     | 0.4     | 0.956          | 0.960              | 0.975  | 4      |\n| **YelpChi**          | roc-auc       | 0.4     | 0.2     | 0.4    | 0.856           | 0.890              | 0.950  | 5      |\n| **Multitarget 10k**  | roc-auc       | 0.6     | 0.2     | 0.2    | 0.730           | 0.838              |        |        |\n| **Multitarget 50k**  | roc-auc       | 0.6     | 0.2     | 0.2    | 0.756           | 0.841              |        |        |\n| **Penn94**           | accuracy      | 0.6     | 0.2     | 0.2    | 0.791           | 0.829              | 0.861  | 12     |\n| **Genius**           | roc-auc       | 0.6     | 0.2     | 0.2    | 0.902           | 0.902              | 0.915  | 12     |\n\n\n# Installation\n## Install with creating conda env\n\n`conda deactivate` \u003cbr\u003e\n`conda create -n cool_graph_env python=3.8 cudatoolkit=11.3.1 pytorch=1.12.0=py3.8_cuda11.3_cudnn8.3.2_0 cxx-compiler=1.5.1 pyg=2.2.0=py38_torch_1.12.0_cu113 pyarrow=11.0.0 numpy=1.23.5 pandas=1.4.4 pip=22.3.1 py=1.11.0 mysqlclient=2.0.3 sqlite=3.38.2 psycopg2=2.8.6 optuna=2.10.1 -c nvidia -c pytorch -c conda-forge -c pyg`  \u003cbr\u003e\n`conda activate cool_graph_env`.   \u003cbr\u003e\n`pip install cool-graph`\n\n\n## Install with creating conda env from yml file\n\n\n`conda deactivate` \u003cbr\u003e\n`conda env create -f environment.yml`  \u003cbr\u003e\n`conda activate cool_graph_env`  \u003cbr\u003e\n`pip install cool-graph`\n\n\n# Get started\n\n\n## Basic usage\n\n\n```python\n# Load Dataset\nfrom torch_geometric import datasets\ndata = datasets.Amazon(root='./data/Amazon', name='Computers').data\n\n# Train GNN model\nfrom cool_graph.runners import Runner\nrunner = Runner(data)\nresult = runner.run()\n```\n\nYou can override default parameters and/or read parameters from config file\n```python\nrunner = Runner(data, \n                metrics=['accuracy', ...], \n                batch_size='auto', \n                train_size=0.7, \n                test_size=0.3, \n                overrides=['training.n_epochs=1', ...], \n                config_path=...)\nresult = runner.run()         \nprint(result['best_loss'])       \n```\n## Runner with Optuna\nYou can run HypeRunner for the best GNN architecture search\n```python\nrunner = HypeRunner(data)\nresult = runner.optimize_run()\n\n```\nFor more information look at Tutorials\n\n# Tutorials\n\n1. [Easy start](/notebooks/Easy_start.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1fyjfK5pZTtAz5axZydFb59eIQdKrBbR8)\n2. [Main features](/notebooks/Usage_examples.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/168saYLMPRXc7BOELzVKG0049en4Rr3Jx)\n3. [Making predictions and metric calculation](h/notebooks/predict_proba_examples.ipynb)\n4. [Working with categorical features](/notebooks/categorical_features_usage_examples.ipynb)\n5. [Working with graph features](/notebooks/graph_features_usage_examples.ipynb)\n5. [Creating your own data loaders](/notebooks/Indices_for_DataLoader.ipynb)\n6. [Working with configs](/notebooks/How_to_work_with_configs.ipynb)\n7. [Benchmarks](/notebooks/benchmarks.ipynb)\n8. [Integration with Mlflow](/notebooks/Integration_with_mlflow.ipynb)\n\n## Library Structure\n\nThe directory structure cool_graph:\n\n```\n├── config                       \u003c- Config structure\n│   ├── data                     \u003c- Data configs (Datasets on disk)\n│   ├── logging                  \u003c- MLFlow configs\n│   ├── metrics                  \u003c- Metrics configs\n│   ├── model_params             \u003c- NN model parameters configs\n│   ├── training                 \u003c- Training  configs\n│   ├── full.yaml                \u003c- Main config for CLI \n│   ├── in_memory_data.yaml      \u003c- Main config for notebook (GraphConv)\n│   ├── in_memory_data2.yaml     \u003c- Main config for notebook (NNConv)\n│\n├── cli                    \u003c- Cli commands\n├── data                   \u003c- Data processing, data loaders, batch sizes\n├── datasets               \u003c- CoolGraph datasets\n├── logging                \u003c- MLflow logging experiments\n├── models                 \u003c- CoolGraph models\n├── parameter_search       \u003c- Sampling model params for Optuna\n├── train                  \u003c- Trainin / eval / metrics code\n├── runners.py             \u003c- Run training (CLI + Notebook)\n\n```\n\n## Development\n\n**add dev dependencies here (or switch to poetry)**\n\nInstall the package using one of the options described above adding `-e` flag to `pip install`.\n\nRun `git checkout -b \u003cnew_branch_name\u003e`.\n\nIntroduce changes to the branch.\n\nTest your changes using `make test`.\n\nAdd tests if necessary (e.g. coverage fell below 80%), run `make test` again.\n\nEnsure that codestyle is OK with `make verify_format`.\n\nIf not, run `make format`.\n\nAfter that commit -\u003e push -\u003e PR.\n\n## Authors\n \n* [Diana Pavlikova](https://github.com/dapavlik)\n* [Sergey Kuliev](https://github.com/kuliev-sd)\n* [Igor Inozemtsev](https://github.com/inozemtsev)\n* [Nikita Zelinskiy](https://github.com/nikita-ds)\n* [Alexey Pristaiko](https://github.com/qwertd105)\n* [Vladislav Kuznetsov](https://github.com/AnanasClassic)\n\n## License \n\n`The MIT License (MIT)\nCopyright 2023 MTS (Mobile Telesystems). All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fcoolgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobiletelesystems%2Fcoolgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fcoolgraph/lists"}