{"id":13775585,"url":"https://github.com/rick12000/confopt","last_synced_at":"2025-05-11T08:32:23.332Z","repository":{"id":212745480,"uuid":"729633680","full_name":"rick12000/confopt","owner":"rick12000","description":"A Library for Conformal Hyperparameter Tuning","archived":false,"fork":false,"pushed_at":"2025-05-02T14:02:58.000Z","size":399,"stargazers_count":30,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-02T15:23:09.247Z","etag":null,"topics":["automl","conformal-prediction","hyperparameter-optimization","hyperparameter-tuning","inferential-statistics","machine-learning","predictive-modeling"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rick12000.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}},"created_at":"2023-12-09T21:05:15.000Z","updated_at":"2025-04-30T17:43:15.000Z","dependencies_parsed_at":"2023-12-16T01:24:37.427Z","dependency_job_id":"b722b4c8-87d6-44cb-a1de-b1814b80c435","html_url":"https://github.com/rick12000/confopt","commit_stats":null,"previous_names":["rick12000/acho","rick12000/confopt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick12000%2Fconfopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick12000%2Fconfopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick12000%2Fconfopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick12000%2Fconfopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rick12000","download_url":"https://codeload.github.com/rick12000/confopt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253539960,"owners_count":21924517,"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":["automl","conformal-prediction","hyperparameter-optimization","hyperparameter-tuning","inferential-statistics","machine-learning","predictive-modeling"],"created_at":"2024-08-03T17:01:41.898Z","updated_at":"2025-05-11T08:32:23.311Z","avatar_url":"https://github.com/rick12000.png","language":"Python","readme":"# ConfOpt\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![arXiv](https://img.shields.io/badge/arXiv-ACHO-cyan)](https://doi.org/10.48550/arXiv.2207.03017)\n\nConfOpt is an inferential hyperparameter optimization package designed to\nspeed up model hyperparameter tuning.\n\nThe package currently implements Adaptive Conformal Hyperparameter Optimization (ACHO), as detailed\nin [the original paper](https://doi.org/10.48550/arXiv.2207.03017).\n\n## Installation\n\nYou can install ConfOpt from [PyPI](https://pypi.org/project/confopt) using `pip`:\n\n```bash\npip install confopt\n```\n\n## Getting Started\n\nAs an example, we'll tune a Random Forest model with data from a regression task.\n\nStart by setting up your training and validation data:\n\n```python\nfrom sklearn.datasets import fetch_california_housing\n\nX, y = fetch_california_housing(return_X_y=True)\nsplit_idx = int(len(X) * 0.5)\nX_train, y_train = X[:split_idx, :], y[:split_idx]\nX_val, y_val = X[split_idx:, :], y[split_idx:]\n```\n\nThen import the Random Forest model to tune and define a search space for\nits parameters (must be a dictionary mapping the model's parameter names to\npossible values of that parameter to search):\n\n```python\nfrom sklearn.ensemble import RandomForestRegressor\n\nparameter_search_space = {\n    \"n_estimators\": [10, 30, 50, 100, 150, 200, 300, 400],\n    \"min_samples_split\": [0.005, 0.01, 0.1, 0.2, 0.3],\n    \"min_samples_leaf\": [0.005, 0.01, 0.1, 0.2, 0.3],\n    \"max_features\": [None, 0.8, 0.9, 1],\n}\n```\n\nNow import the `ConformalSearcher` class and initialize it with:\n\n- The model to tune.\n- The raw X and y data.\n- The parameter search space.\n- An extra variable clarifying whether this is a regression or classification problem.\n\nHyperparameter tuning can be kicked off with the `search` method and a specification\nof how long the tuning should run for (in seconds):\n\n```python\nfrom confopt.tuning import ConformalSearcher\n\nsearcher = ConformalSearcher(\n    model=RandomForestRegressor(),\n    X_train=X_train,\n    y_train=y_train,\n    X_val=X_val,\n    y_val=y_val,\n    search_space=parameter_search_space,\n    prediction_type=\"regression\",\n)\n\nsearcher.search(\n    runtime_budget=120  # How many seconds to run the search for\n)\n```\n\nOnce done, you can retrieve the best parameters obtained during tuning using:\n\n```python\nbest_params = searcher.get_best_params()\n```\n\nOr automatically retrain your model on full data and optimal parameters with:\n\n```python\nbest_model = searcher.fit_best_model()\n```\n\nMore information on specific parameters and overrides not mentioned\nin this walk-through can be found in the docstrings or in the `examples`\nfolder of the main repository.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frick12000%2Fconfopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frick12000%2Fconfopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frick12000%2Fconfopt/lists"}