{"id":13775557,"url":"https://github.com/msesia/chr","last_synced_at":"2025-10-30T05:28:18.086Z","repository":{"id":42936237,"uuid":"364081309","full_name":"msesia/chr","owner":"msesia","description":"Conformal Histogram Regression: efficient conformity scores for non-parametric regression problems","archived":false,"fork":false,"pushed_at":"2022-03-26T02:19:50.000Z","size":223,"stargazers_count":19,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-02-13T07:42:52.554Z","etag":null,"topics":["conformal-prediction","machine-learning","quantile-regression","regression","uncertainty-quantification"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msesia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-03T22:50:32.000Z","updated_at":"2023-09-07T03:38:32.000Z","dependencies_parsed_at":"2022-09-23T15:09:23.226Z","dependency_job_id":null,"html_url":"https://github.com/msesia/chr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msesia%2Fchr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msesia%2Fchr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msesia%2Fchr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msesia%2Fchr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msesia","download_url":"https://codeload.github.com/msesia/chr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225027455,"owners_count":17409437,"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":["conformal-prediction","machine-learning","quantile-regression","regression","uncertainty-quantification"],"created_at":"2024-08-03T17:01:41.192Z","updated_at":"2025-10-30T05:28:13.053Z","avatar_url":"https://github.com/msesia.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Conformal histogram regression\n\nThis repository contains a Python implementation of the conformal prediction method described in the accompanying paper: https://arxiv.org/abs/2105.08747\n\n```\nMatteo Sesia, Yaniv Romano\n\"Conformal Prediction using Conditional Histograms\"\nNeurIPS 2021 (spotlight)\n```\n\n## Overview\n\nConformal histogram regression (CHR) computes prediction intervals for non-parametric\nregression that can automatically adapt to skewed data. It leverages black-box\nmachine learning algorithms to estimate the conditional distribution of the outcome\nusing histograms, and then translates their output into the shortest prediction\nintervals with approximate conditional coverage. \nThe theoretical results presented in the paper prove the resulting prediction\nintervals have marginal coverage in finite samples, while asymptotically achiev-\ning conditional coverage and optimal length if the black-box model is consistent.\nThe code included here was utilized to carry out the numerical experiments with simulated and real data described in the paper,\nwhich demonstrate empirically the improved performance of CHR compared to state-of-the-art alternatives, including conformalized quantile\nregression and other distributional conformal prediction approaches.\n\n## Dependencies\n\nThis code is written for Python (v 3.7.6) and makes use of the following packages:\n - torch (v 1.6.0)\n - numpy (v 1.18.5)\n - pandas (v 1.1.0)\n - scipy (v 1.4.1)\n - six (v 1.15.0)\n - sklearn (v 0.23.2)\n - skgarden (v 0.1.2)\n - rpy2 (v 3.3.5) (optional and requires R installation with BART package, not used in the paper)\n\nThe tutorial notebook in the \"examples/\" directory is written for Jupyter and was originally compiled with the following setup.\n - jupyter core     : 4.6.3\n - jupyter-notebook : 6.0.3\n - qtconsole        : not installed\n - ipython          : 7.13.0\n - ipykernel        : 5.2.0\n - jupyter client   : 6.1.2\n - jupyter lab      : not installed\n - nbconvert        : 5.6.1\n - ipywidgets       : 7.6.3\n - nbformat         : 5.0.4\n - traitlets        : 4.3.3 \n \n This repository also included code to process the experimental results and produce the figures shown in the paper.\n This is written in [R](https://www.r-project.org/) (v 4.0.3) and relies on the [tidyverse](https://www.tidyverse.org/) package (v 1.3.0).\n \n ## Instructions\n\nOur method is implemented in the package contained within the \"chr/\" directory.\nThis can be loaded and utilized as demonstrated in the tutorial notebook \"examples/intro.ypynb\".\n\nThe Python code needed to reproduce our numerical experiments are in the \"experiments/\" directory,\nalong with bash scripts to submit the experiments, either sequentially (default), or on a computing cluster with a slurm interface.\nThe script \"experiments/dataset.py\" loads and pre-processes the real data sets, which can be dowloaded freely from the sources referenced in the accompanying paper. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsesia%2Fchr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsesia%2Fchr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsesia%2Fchr/lists"}