{"id":51249562,"url":"https://github.com/raphaelsenn/hpolite","last_synced_at":"2026-06-29T06:31:04.938Z","repository":{"id":361378736,"uuid":"1254245351","full_name":"raphaelsenn/hpolite","owner":"raphaelsenn","description":"You are interested in hyperparameter optimization? You like micrograd? Then You love hpolite!","archived":false,"fork":false,"pushed_at":"2026-05-30T10:29:45.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T12:12:21.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/raphaelsenn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T10:22:24.000Z","updated_at":"2026-05-30T10:29:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/raphaelsenn/hpolite","commit_stats":null,"previous_names":["raphaelsenn/hpolite"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/hpolite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhpolite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhpolite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhpolite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhpolite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/hpolite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhpolite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34916407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-29T06:31:04.789Z","updated_at":"2026-06-29T06:31:04.925Z","avatar_url":"https://github.com/raphaelsenn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hpolite\nYou are interested in hyperparameter optimization? You like micrograd? Then You love hpolite!\n\nA tiny (educational) Hyperparameter optimization libary that builts on top of sklearn.\n\nhpolite implements the following search algorithms:\n\n* GridSearchCV\n* RandomSearchCV\n* BayesianSearchCV (Bayesian optimization)\n* HalvingRandomSearchCV  (Multi-fidelity algorithm)\n* HyperbandSearchCV  (Multi-fidelity algorithm)\n* EvolutionSearchCV (Genetic algorithm)\n\nhpolite implements the following surrogate models:\n\n* GaussianProcess\n* RandomForest (TODO)\n* Bayesian Neural Network (TODO)\n\nhpolite implements the following aquisition functions:\n\n* Probability of improvement\n* Expected improvement\n* Lower confidence bound\n* Thompson Sampling (TODO)\n* Entropy search (TODO)\n* Knowledge Gradient (TODO)\n\n## Usage\n\n```python\nfrom sklearn.svm import SVC\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.model_selection import train_test_split\n\nfrom hpolite import BayesianSearchCV, Categorical, Real\nfrom hpolite.aquisition import EI, # or PI, ES, KG, TS \nfrom hpolite.surrogates import GaussianProcess # or RandomForest\n\nX, y = load_breast_cancer(return_X_y=True)  \nX_train, X_test, y_train, y_test = train_test_split(\n    X, \n    y, \n    train_size=0.7,\n    random_state=0\n)\n\n# Define the search space\nparam_grid = {\n    'C':        Real(1e0, 1e3, prior=\"log-uniform\"), \n    'gamma':    Real(1e-5, 1e0, prior=\"log-uniform\"), \n    'kernel':   Categorical(['rbf'])\n}  \n\nsurrogate = GaussianProcess()\naquisition_func = EI(surrogate)\nbs = BayesianSearchCV(SVC(), surrogate, aquisition_func, param_grid)\nbs.fit(X_train, y_train)\n\nprint(bs.best_params_)\nprint(bs.best_score_)\n```\n\n## Citations\n\n```bibtex\n@book{automl,\n    editor = {Hutter, Frank and Kotthoff, Lars and Vanschoren, Joaquin},\n    publisher = {Springer},\n    title = {Automatic Machine Learning: Methods, Systems, Challenges},\n    year = {2019}\n}\n\n@inproceedings{feurer_hyperparameter_2019,\n    author = {Feurer, Matthias and Hutter, Frank},\n    title = {Hyperparameter Optimization},\n    pages = {3-38},\n    chapter = {1},\n    crossref = {automl}\n}\n\n@inproceedings{vanschoren_meta_2019,\n    author = {Vanschoren, Joaquin},\n    title = {Meta-Learning},\n    pages = {39-68},\n    chapter = {2},\n    crossref = {automl}\n}\n\n@misc{jamieson2015nonstochasticbestarmidentification,\n      title={Non-stochastic Best Arm Identification and Hyperparameter Optimization}, \n      author={Kevin Jamieson and Ameet Talwalkar},\n      year={2015},\n      eprint={1502.07943},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG},\n      url={https://arxiv.org/abs/1502.07943}, \n}\n\n@misc{li2018hyperbandnovelbanditbasedapproach,\n      title={Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization}, \n      author={Lisha Li and Kevin Jamieson and Giulia DeSalvo and Afshin Rostamizadeh and Ameet Talwalkar},\n      year={2018},\n      eprint={1603.06560},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG},\n      url={https://arxiv.org/abs/1603.06560}, \n}\n\n@misc{falkner2018bohbrobustefficienthyperparameter,\n      title={BOHB: Robust and Efficient Hyperparameter Optimization at Scale}, \n      author={Stefan Falkner and Aaron Klein and Frank Hutter},\n      year={2018},\n      eprint={1807.01774},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG},\n      url={https://arxiv.org/abs/1807.01774}, \n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fhpolite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fhpolite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fhpolite/lists"}