{"id":14958185,"url":"https://github.com/tusharsarkar3/xbnet","last_synced_at":"2025-04-05T09:06:27.586Z","repository":{"id":40955734,"uuid":"373605717","full_name":"tusharsarkar3/XBNet","owner":"tusharsarkar3","description":"Boosted neural network for tabular data","archived":false,"fork":false,"pushed_at":"2024-07-25T11:19:27.000Z","size":9961,"stargazers_count":212,"open_issues_count":14,"forks_count":46,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-05T09:06:20.352Z","etag":null,"topics":["deep-learning","hacktoberfest","machine-learning","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tusharsarkar3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"License.txt","code_of_conduct":"CODE-OF-CONDUCT.md","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":"2021-06-03T18:30:54.000Z","updated_at":"2025-03-10T03:59:45.000Z","dependencies_parsed_at":"2024-09-21T21:40:39.581Z","dependency_job_id":null,"html_url":"https://github.com/tusharsarkar3/XBNet","commit_stats":{"total_commits":43,"total_committers":3,"mean_commits":"14.333333333333334","dds":"0.32558139534883723","last_synced_commit":"2b771d6beb9f15ae48e2a365f46d6f996811086f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsarkar3%2FXBNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsarkar3%2FXBNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsarkar3%2FXBNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsarkar3%2FXBNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tusharsarkar3","download_url":"https://codeload.github.com/tusharsarkar3/XBNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312077,"owners_count":20918344,"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":["deep-learning","hacktoberfest","machine-learning","pytorch"],"created_at":"2024-09-24T13:16:26.295Z","updated_at":"2025-04-05T09:06:27.536Z","avatar_url":"https://github.com/tusharsarkar3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XBNet - Xtremely Boosted Network\n## Boosted neural network for tabular data\n\n[![](https://img.shields.io/badge/Made_with-PyTorch-res?style=for-the-badge\u0026logo=pytorch)](https://pytorch.org/ \"PyTorch\")\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/xbnet-an-extremely-boosted-neural-network/iris-classification-on-iris)](https://paperswithcode.com/sota/iris-classification-on-iris?p=xbnet-an-extremely-boosted-neural-network)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/xbnet-an-extremely-boosted-neural-network/diabetes-prediction-on-diabetes)](https://paperswithcode.com/sota/diabetes-prediction-on-diabetes?p=xbnet-an-extremely-boosted-neural-network)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/xbnet-an-extremely-boosted-neural-network/survival-prediction-on-titanic)](https://paperswithcode.com/sota/survival-prediction-on-titanic?p=xbnet-an-extremely-boosted-neural-network)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/xbnet-an-extremely-boosted-neural-network/breast-cancer-detection-on-breast-cancer-1)](https://paperswithcode.com/sota/breast-cancer-detection-on-breast-cancer-1?p=xbnet-an-extremely-boosted-neural-network)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/xbnet-an-extremely-boosted-neural-network/fraud-detection-on-kaggle-credit-card-fraud)](https://paperswithcode.com/sota/fraud-detection-on-kaggle-credit-card-fraud?p=xbnet-an-extremely-boosted-neural-network)\n\u003cdiv class='altmetric-embed' data-badge-type='donut' data-arxiv-id='2106.05239'\u003e\u003c/div\u003e\n\n[![Downloads](https://pepy.tech/badge/xbnet)](https://pepy.tech/project/xbnet) \n\u003c!-- [![Downloads](https://pepy.tech/badge/xbnet/month)](https://pepy.tech/project/xbnet)\n[![Downloads](https://pepy.tech/badge/xbnet/week)](https://pepy.tech/project/xbnet) --\u003e\n\nXBNET that is built on PyTorch combines tree-based models with neural networks to create a robust architecture that is trained by using\na novel optimization technique, Boosted Gradient Descent for Tabular\nData which increases its interpretability and performance. Boosted Gradient Descent is initialized with the\nfeature importance of a gradient boosted tree, and it updates the weights of each\nlayer in the neural network in two steps:\n- Update weights by gradient descent.\n- Update weights by using feature importance of a gradient boosted tree\nin every intermediate layer.\n\n## Features\n\n- Better performance, training stability and interpretability for tabular data.\n- Easy to implement with rapid prototyping capabilities\n- Minimum Code requirements for creating any neural network with or without boosting\n---\n### Comparison with XGBOOST\nXBNET VS XGBOOST testing accuracy on different datasets with no hyperparameter tuning\n\n| Dataset | XBNET  | XGBOOST |\n| ---------------- | ---------------- | ---------------- |\n| Iris  | \u003cb\u003e100\u003c/b\u003e  | 97.7 |\n| Breast Cancer  | \u003cb\u003e96.49\u003c/b\u003e  | 96.47 |\n| Wine  | \u003cb\u003e97.22\u003c/b\u003e  | \u003cb\u003e97.22\u003c/b\u003e |\n| Diabetes  | \u003cb\u003e78.78\u003c/b\u003e  | 77.48 |\n| Titanic  | 79.85  | \u003cb\u003e80.5\u003c/b\u003e |\n| German Credit  | 71.33  | \u003cb\u003e77.66\u003c/b\u003e |\n| Digit Completion  | 86.11 85.9  | \u003cb\u003e77.66\u003c/b\u003e |\n\n---\n### Installation :\n```\npip install --upgrade git+https://github.com/tusharsarkar3/XBNet.git\n```\n---\n\n### Example for using\n```\nimport torch\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.model_selection import train_test_split\nfrom XBNet.training_utils import training,predict\nfrom XBNet.models import XBNETClassifier\nfrom XBNet.run import run_XBNET\n\ndata = pd.read_csv('test\\Iris (1).csv')\nprint(data.shape)\nx_data = data[data.columns[:-1]]\nprint(x_data.shape)\ny_data = data[data.columns[-1]]\nle = LabelEncoder()\ny_data = np.array(le.fit_transform(y_data))\nprint(le.classes_)\n\nX_train,X_test,y_train,y_test = train_test_split(x_data.to_numpy(),y_data,test_size = 0.3,random_state = 0)\nmodel = XBNETClassifier(X_train,y_train,2)\n\ncriterion = torch.nn.CrossEntropyLoss()\noptimizer = torch.optim.Adam(model.parameters(), lr=0.01)\n\nm,acc, lo, val_ac, val_lo = run_XBNET(X_train,X_test,y_train,y_test,model,criterion,optimizer,32,300)\nprint(predict(m,x_data.to_numpy()[0,:]))\n```\n---\n### Output images :\n\n![img](screenshots/Results_metrics.png)  \n![img](screenshots/results_graph.png)\n---\n\n### Reference\nIf you make use of this software for your work, we would appreciate it if you would cite us:\n```\n@misc{sarkar2021xbnet,\n      title={XBNet : An Extremely Boosted Neural Network}, \n      author={Tushar Sarkar},\n      year={2021},\n      eprint={2106.05239},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG}\n}\n```\n\n```\n@misc{1aa4d286-fae9-431e-bd08-63c1b9c848e2,\n  title = {Library XBNet for tabular data which helps you to create a custom extremely boosted neural network},\n  author = {Tushar Sarkar},\n   journal = {Software Impacts},\n  doi = {10.24433/CO.8976286.v1}, \n  howpublished = {\\url{https://www.codeocean.com/}},\n  year = 2021,\n  month = {6},\n  version = {v1}\n}\n```\n\n---\n #### Features to be added :\n- Metrics for different requirements\n- Addition of some other types of layers\n\n---\n\n\u003ch3 align=\"center\"\u003e\u003cb\u003eDeveloped with :heart: by \u003ca href=\"https://github.com/tusharsarkar3\"\u003eTushar Sarkar\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftusharsarkar3%2Fxbnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftusharsarkar3%2Fxbnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftusharsarkar3%2Fxbnet/lists"}