{"id":17465021,"url":"https://github.com/erdogant/hgboost","last_synced_at":"2026-04-06T22:01:13.135Z","repository":{"id":50305934,"uuid":"257025146","full_name":"erdogant/hgboost","owner":"erdogant","description":"hgboost is a python package for hyper-parameter optimization for xgboost, catboost or lightboost using cross-validation, and evaluating the results on an independent validation set. hgboost can be applied for classification and regression tasks.","archived":false,"fork":false,"pushed_at":"2026-04-06T09:42:37.000Z","size":25525,"stargazers_count":66,"open_issues_count":6,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-06T11:08:58.251Z","etag":null,"topics":["catboost","crossvalidation","gridsearch","hyperoptimization","lightboost","machine-learning","python","xgboost"],"latest_commit_sha":null,"homepage":"http://erdogant.github.io/hgboost","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erdogant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["erdogant"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-04-19T14:48:23.000Z","updated_at":"2026-04-06T09:42:45.000Z","dependencies_parsed_at":"2025-03-29T03:11:41.587Z","dependency_job_id":"e1872c13-20ce-4adf-a10a-53f0e9b37079","html_url":"https://github.com/erdogant/hgboost","commit_stats":{"total_commits":269,"total_committers":3,"mean_commits":89.66666666666667,"dds":"0.13011152416356875","last_synced_commit":"0d1caeee6c11ebe8f3b60e6a80af7acdda9ca653"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/erdogant/hgboost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fhgboost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fhgboost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fhgboost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fhgboost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erdogant","download_url":"https://codeload.github.com/erdogant/hgboost/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fhgboost/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31491097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["catboost","crossvalidation","gridsearch","hyperoptimization","lightboost","machine-learning","python","xgboost"],"created_at":"2024-10-18T11:08:29.441Z","updated_at":"2026-04-06T22:01:13.119Z","avatar_url":"https://github.com/erdogant.png","language":"Python","funding_links":["https://github.com/sponsors/erdogant","https://www.buymeacoffee.com/erdogant)--","https://www.buymeacoffee.com/erdogant"],"categories":[],"sub_categories":[],"readme":"# hgboost - Hyperoptimized Gradient Boosting\n\n[![Python](https://img.shields.io/pypi/pyversions/hgboost)](https://img.shields.io/pypi/pyversions/hgboost)\n[![PyPI Version](https://img.shields.io/pypi/v/hgboost)](https://pypi.org/project/hgboost/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/erdogant/hgboost/blob/master/LICENSE)\n[![Github Forks](https://img.shields.io/github/forks/erdogant/hgboost.svg)](https://github.com/erdogant/hgboost/network)\n[![GitHub Open Issues](https://img.shields.io/github/issues/erdogant/hgboost.svg)](https://github.com/erdogant/hgboost/issues)\n[![Project Status](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![Downloads](https://pepy.tech/badge/hgboost/month)](https://pepy.tech/project/hgboost/month)\n[![Downloads](https://pepy.tech/badge/hgboost)](https://pepy.tech/project/hgboost)\n[![DOI](https://zenodo.org/badge/257025146.svg)](https://zenodo.org/badge/latestdoi/257025146)\n[![Sphinx](https://img.shields.io/badge/Sphinx-Docs-Green)](https://erdogant.github.io/hgboost/)\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://erdogant.github.io/hgboost/pages/html/Documentation.html#colab-classification-notebook)\n[![Medium](https://img.shields.io/badge/Medium-Blog-green)](https://erdogant.github.io/hgboost/pages/html/Documentation.html#medium-blog)\n\u003c!---[![BuyMeCoffee](https://img.shields.io/badge/buymea-coffee-yellow.svg)](https://www.buymeacoffee.com/erdogant)--\u003e\n\u003c!---[![Coffee](https://img.shields.io/badge/coffee-black-grey.svg)](https://erdogant.github.io/donate/?currency=USD\u0026amount=5)--\u003e\n\n--------------------------------------------------------------------\n\n``hgboost`` is short for **Hyperoptimized Gradient Boosting** and is a python package for hyperparameter optimization for *xgboost*, *catboost* and *lightboost* using cross-validation, and evaluating the results on an independent validation set.\n``hgboost`` can be applied for classification and regression tasks.\n\n``hgboost`` is fun because:\n\n    * 1. Hyperoptimization of the Parameter-space using bayesian approach.\n    * 2. Determines the best scoring model(s) using k-fold cross validation.\n    * 3. Evaluates best model on independent evaluation set.\n    * 4. Fit model on entire input-data using the best model.\n    * 5. Works for classification and regression\n    * 6. Creating a super-hyperoptimized model by an ensemble of all individual optimized models.\n    * 7. Return model, space and test/evaluation results.\n    * 8. Makes insightful plots.\n\n--------------------------------------------------------------------\n\n**⭐️ Star this repo if you like it ⭐️**\n\n--------------------------------------------------------------------\n\n### Blogs\n\nMedium Blog 1: \n[The Best Boosting Model using Bayesian Hyperparameter Tuning but without Overfitting.](https://erdogant.github.io/hgboost/pages/html/Documentation.html#medium-blog)\n\nMedium Blog 2: \n[Create Explainable Gradient Boosting Classification models using Bayesian Hyperparameter Optimization.](https://erdogant.github.io/hgboost/pages/html/Documentation.html#medium-blog)\n\n--------------------------------------------------------------------\n\n### [Documentation pages](https://erdogant.github.io/hgboost/)\n\nOn the [documentation pages](https://erdogant.github.io/hgboost/) you can find detailed information about the working of the ``hgboost`` with many examples. \n\n--------------------------------------------------------------------\n\n\n## Colab Notebooks\n\n* \u003ca href=\"https://erdogant.github.io/hgboost/pages/html/Documentation.html#colab-regression-notebook\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open regression example In Colab\"/\u003e \u003c/a\u003e Regression example \n\n* \u003ca href=\"https://erdogant.github.io/hgboost/pages/html/Documentation.html#colab-classification-notebook\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open classification example In Colab\"/\u003e \u003c/a\u003e Classification example \n\n--------------------------------------------------------------------\n\n\n### Schematic overview of hgboost\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/schematic_overview.png\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\n### Installation Environment\n\n```python\nconda create -n env_hgboost python=3.8\nconda activate env_hgboost\n```\n\n### Install from pypi\n\n```bash\npip install hgboost\npip install -U hgboost # Force update\n\n```\n\n#### Import hgboost package\n```python\nimport hgboost as hgboost\n```\n\n#### Examples\n\n* [Example: Fit catboost by hyperoptimization and cross-validation](https://erdogant.github.io/hgboost/pages/html/Examples.html#catboost)\n\n#\n\n* [Example: Fit lightboost by hyperoptimization and cross-validation](https://erdogant.github.io/hgboost/pages/html/Examples.html#lightboost)\n\n#\n\n* [Example: Fit xgboost by hyperoptimization and cross-validation](https://erdogant.github.io/hgboost/pages/html/Examples.html#xgboost-two-class)\n\n#\n\n* [Example: Plot searched parameter space](https://erdogant.github.io/hgboost/pages/html/Examples.html#plot-params)\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_params_clf_1.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_params_clf_2.png\" width=\"400\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n#\n\n* [Example: plot summary](https://erdogant.github.io/hgboost/pages/html/Examples.html#plot-summary)\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_clf.png\" width=\"600\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n#\n\n* [Example: Tree plot](https://erdogant.github.io/hgboost/pages/html/Examples.html#treeplot)\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/treeplot_clf_1.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/treeplot_clf_2.png\" width=\"400\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n#\n\n* [Example: Plot the validation results](https://erdogant.github.io/hgboost/pages/html/Examples.html#plot-validation)\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_validation_clf_1.png\" width=\"600\" /\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_validation_clf_2.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_validation_clf_3.png\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n#\n\n* [Example: Plot the cross-validation results](https://erdogant.github.io/hgboost/pages/html/Examples.html#plot-cv)\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_cv_clf.png\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\n#\n\n* [Example: use the learned model to make new predictions](https://erdogant.github.io/hgboost/pages/html/hgboost.hgboost.html?highlight=predict#hgboost.hgboost.hgboost.predict)\n\n#\n\n* [Example: Create ensemble model for Classification](https://erdogant.github.io/hgboost/pages/html/Examples.html#ensemble-classification)\n\n#\n\n* [Example: Create ensemble model for Regression](https://erdogant.github.io/hgboost/pages/html/Examples.html#ensemble-regression)\n\n#\n\n#### Classification example for xgboost, catboost and lightboost:\n```python\n\n# Load library\nfrom hgboost import hgboost\n\n# Initialization\nhgb = hgboost(max_eval=10, threshold=0.5, cv=5, test_size=0.2, val_size=0.2, top_cv_evals=10, random_state=42)\n\n# Fit xgboost by hyperoptimization and cross-validation\nresults = hgb.xgboost(X, y, pos_label='survived')\n\n# [hgboost] \u003eStart hgboost classification..\n# [hgboost] \u003eCollecting xgb_clf parameters.\n# [hgboost] \u003eNumber of variables in search space is [11], loss function: [auc].\n# [hgboost] \u003emethod: xgb_clf\n# [hgboost] \u003eeval_metric: auc\n# [hgboost] \u003egreater_is_better: True\n# [hgboost] \u003epos_label: True\n# [hgboost] \u003eTotal dataset: (891, 204) \n# [hgboost] \u003eHyperparameter optimization..\n#  100% |----| 500/500 [04:39\u003c05:21,  1.33s/trial, best loss: -0.8800619834710744]\n# [hgboost] \u003eBest performing [xgb_clf] model: auc=0.881198\n# [hgboost] \u003e5-fold cross validation for the top 10 scoring models, Total nr. tests: 50\n# 100%|██████████| 10/10 [00:42\u003c00:00,  4.27s/it]\n# [hgboost] \u003eEvalute best [xgb_clf] model on independent validation dataset (179 samples, 20.00%).\n# [hgboost] \u003e[auc] on independent validation dataset: -0.832\n# [hgboost] \u003eRetrain [xgb_clf] on the entire dataset with the optimal parameters settings.\n```\n\n\n```python\n\n# Plot the ensemble classification validation results\nhgb.plot_validation()\n\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_ensemble_clf_1.png\" width=\"600\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_ensemble_clf_2.png\" width=\"400\" /\u003e\n  \u003cimg src=\"https://github.com/erdogant/hgboost/blob/master/docs/figs/plot_ensemble_clf_3.png\" width=\"400\" /\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n**References**\n\n    * http://hyperopt.github.io/hyperopt/\n    * https://github.com/dmlc/xgboost\n    * https://github.com/microsoft/LightGBM\n    * https://github.com/catboost/catboost\n    \n**Maintainers**\n* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)\n\n**Contribute**\n* Contributions are welcome.\n\n**Licence**\nSee [LICENSE](LICENSE) for details.\n\n**Coffee**\n* If you wish to buy me a \u003ca href=\"https://www.buymeacoffee.com/erdogant\"\u003eCoffee\u003c/a\u003e for this work, it is very appreciated :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdogant%2Fhgboost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferdogant%2Fhgboost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdogant%2Fhgboost/lists"}