predictset

R 패키지 메타데이터와 수집 신호를 모아 봅니다.

Packages / CRAN / predictset

predictset

v0.3.0
Repository CRANLicense MIT + file LICENSENeeds compilation no
DOI
10.32614/CRAN.package.predictset

Core Signals

첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.

0
표시할 핵심 신호가 없습니다.

Supported Backends

DESCRIPTION에서 감지한 backend 관련 package입니다.

0
backend package 신호가 없습니다.

Quick Facts

기본 메타데이터를 작은 카드와 토큰으로 압축합니다.

profile
Repository
CRAN
Version
0.3.0
License
MIT + file LICENSE
Needs compilation
no
Last observed
2026-05-30
CRAN
cran.r-project.org/package=predictset

수집 소스별 패키지 정보

1개 소스
CRAN
0.3.0
2026-05-30
License
MIT + file LICENSE
Depends
R (>= 4.1.0)
Imports
cli (>= 3.6.0), grDevices, graphics, stats
Suggests
testthat (>= 3.0.0), ranger, ggplot2, knitr, rmarkdown, parsnip (>= 1.0.0), probably, rsample, workflows
Needs compilation
no
Last observed
2026-05-30 10:45:11

이 패키지가 의존하는 패키지

5개 표시전체 13개
PackageTypeSpec
cli
CRAN · 0.3.0 · 2026-05-30
Importscli (>= 3.6.0)
graphics
CRAN · 0.3.0 · 2026-05-30
Importsgraphics
grDevices
CRAN · 0.3.0 · 2026-05-30
ImportsgrDevices
stats
CRAN · 0.3.0 · 2026-05-30
Importsstats
ggplot2
CRAN · 0.3.0 · 2026-05-30
Suggestsggplot2
1 / 3

이 패키지를 쓰는 패키지

0개 표시전체 0개
PackageTypeSpec
표시할 dependency edge가 없습니다.
1 / 1

패키지 페이지

All links
36
Repository
CRAN
Version
0.3.0
Collected
2026-05-15 23:04:08
Package page
https://cran.r-project.org/web/packages/predictset/index.html
DOI
10.32614/CRAN.package.predictset
Citation
https://cran.r-project.org/web/packages/predictset/citation.html
CRAN checks
https://cran.r-project.org/web/checks/check_results_predictset.html
README
https://cran.r-project.org/web/packages/predictset/readme/README.html
NEWS
https://cran.r-project.org/web/packages/predictset/news/news.html
Reference HTML
https://cran.r-project.org/web/packages/predictset/refman/predictset.html
Reference PDF
https://cran.r-project.org/web/packages/predictset/predictset.pdf
Source package
https://cran.r-project.org/src/contrib/predictset_0.3.0.tar.gz
Page fields
Author
Charles Coverdale [aut, cre, cph]
BugReports
https://github.com/charlescoverdale/predictset/issues
CRAN Checks
predictset results
Citation
predictset citation info
DOI
10.32614/CRAN.package.predictset
Language
en-US
License
MIT + file LICENSE
Maintainer
Charles Coverdale <charlesfcoverdale at gmail.com>
Materials
README , NEWS
NeedsCompilation
no
Package Source
predictset_0.3.0.tar.gz
Published
2026-03-19
Reference Manual
predictset.html , predictset.pdf
URL
https://github.com/charlescoverdale/predictset
Version
0.3.0
Vignettes
Getting Started with predictset ( source , R code )
Windows Binaries
r-devel: predictset_0.3.0.zip , r-release: predictset_0.3.0.zip , r-oldrel: predictset_0.3.0.zip
MacOS Binaries
r-release (arm64): predictset_0.3.0.tgz , r-oldrel (arm64): predictset_0.3.0.tgz , r-release (x86_64): predictset_0.3.0.tgz , r-oldrel (x86_64): predictset_0.3.0.tgz
Version
0.3.0
Published
2026-03-19
DOI
10.32614/CRAN.package.predictset
Author
Charles Coverdale [aut, cre, cph]
Maintainer
Charles Coverdale <charlesfcoverdale at gmail.com>
BugReports
https://github.com/charlescoverdale/predictset/issues
License
MIT + file LICENSE
URL
https://github.com/charlescoverdale/predictset
NeedsCompilation
no
Language
en-US
Citation
predictset citation info
Materials
README , NEWS
CRAN Checks
predictset results
Reference Manual
predictset.html , predictset.pdf
Vignettes
Getting Started with predictset ( source , R code )
Package Source
predictset_0.3.0.tar.gz
Windows Binaries
r-devel: predictset_0.3.0.zip , r-release: predictset_0.3.0.zip , r-oldrel: predictset_0.3.0.zip
MacOS Binaries
r-release (arm64): predictset_0.3.0.tgz , r-oldrel (arm64): predictset_0.3.0.tgz , r-release (x86_64): predictset_0.3.0.tgz , r-oldrel (x86_64): predictset_0.3.0.tgz
Page sections 3
Documentation
Heading
Documentation
Links
[{"label":"predictset.html","section":"","type":"","url":"https://cran.r-project.org/web/packages/predictset/refman/predictset.html"},{"label":"predictset.pdf","section":"","type":"","url":"https://cran.r-project.org/web/packages/predictset/predictset.pdf"},{"label":"Getting Started with predictset","section":"","type":"","url":"https://cran.r-project.org/web/packages/predictset/vignettes/predictset.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/predictset/vignettes/predictset.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/predictset/vignettes/predictset.R"}]
Text
Reference manual: predictset.html , predictset.pdf Vignettes: Getting Started with predictset ( source , R code )
Downloads
Heading
Downloads
Links
[{"label":"predictset_0.3.0.tar.gz","section":"","type":"","url":"https://cran.r-project.org/src/contrib/predictset_0.3.0.tar.gz"},{"label":"predictset_0.3.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.7/predictset_0.3.0.zip"},{"label":"predictset_0.3.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.6/predictset_0.3.0.zip"},{"label":"predictset_0.3.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.5/predictset_0.3.0.zip"},{"label":"predictset_0.3.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/sonoma-arm64/contrib/4.6/predictset_0.3.0.tgz"},{"label":"predictset_0.3.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/predictset_0.3.0.tgz"},{"label":"predictset_0.3.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.6/predictset_0.3.0.tgz"},{"label":"predictset_0.3.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.5/predictset_0.3.0.tgz"}]
Text
Package source: predictset_0.3.0.tar.gz Windows binaries: r-devel: predictset_0.3.0.zip , r-release: predictset_0.3.0.zip , r-oldrel: predictset_0.3.0.zip macOS binaries: r-release (arm64): predictset_0.3.0.tgz , r-oldrel (arm64): predictset_0.3.0.tgz , r-release (x86_64): predictset_0.3.0.tgz , r-oldrel (x86_64): predictset_0.3.0.tgz
Linking
Heading
Linking
Links
[{"label":"https://CRAN.R-project.org/package=predictset","section":"","type":"","url":"https://CRAN.R-project.org/package=predictset"}]
Text
Please use the canonical form https://CRAN.R-project.org/package=predictset to link to this page.
Materials 2
Documentation 5
Vignettes 3
Downloads 8
All page links 36

패키지 문서 원문

5 artifacts
citation
Citation
CRAN · 0.3.0 · Citation · text/html · 969 · 2026-05-07
Title
CRAN: predictset citation info
Label
Citation
Text content
Text content
CRAN: predictset citation info Coverdale C (2026). predictset: Model-Agnostic Conformal Prediction for Classification and Regression . R package version 0.3.0, https://github.com/charlescoverdale/predictset . Corresponding BibTeX entry: @Manual{, title = {predictset: Model-Agnostic Conformal Prediction for Classification and Regression}, author = {Charles Coverdale}, year = {2026}, note = {R package version 0.3.0}, url = {https://github.com/charlescoverdale/predictset}, }
field
NEWS
CRAN · 0.3.0 · Materials · text/html · 2,797 · 2026-05-07
Title
NEWS
Label
NEWS
Text content
Text content
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} predictset 0.3.0 Documentation Documented Jackknife+ and CV+ theoretical coverage guarantee (1-2alpha) per Barber et al. (2021) Documented ACI asymptotic (not finite-sample) coverage guarantee per Gibbs and Candes (2021) Documented CQR dependence on quantile model quality Documented deterministic vs randomized APS variants Added coverage guarantee footnotes to README and vignette method tables Internal Added graphics and grDevices to DESCRIPTION Imports Added missing test dependencies to Suggests predictset 0.2.0 New features conformal_mondrian() and conformal_mondrian_class() for group-conditional (Mondrian) conformal prediction conformal_weighted() for weighted conformal prediction under covariate shift conformal_aci() for adaptive conformal inference (sequential prediction) conformal_pvalue() for conformal p-values conformal_compare() for benchmarking multiple methods side-by-side coverage_by_group() and coverage_by_bin() for conditional coverage diagnostics Progress bars via verbose = TRUE for conformal_jackknife() and conformal_cv() Improvements NA/NaN/Inf input validation with informative error messages Column dimension checks between training and test data Probability matrix column validation for classification methods Graceful handling of unseen factor levels in APS/RAPS/LAC scoring Negative scale model prediction warnings for normalized conformal predictset 0.1.0 Initial release with split conformal, CV+, Jackknife+, CQR (regression) and split, APS, RAPS, LAC (classification)
field
README
CRAN · 0.3.0 · Materials · text/html · 66,137 · 2026-05-07
Title
README
Label
README
Text content
Text content
README code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ predictset predictset is an R package for model-agnostic conformal prediction and distribution-free uncertainty quantification. It constructs prediction intervals (regression) and prediction sets (classification) with finite-sample coverage guarantees - no distributional assumptions required. Works with any model: lm , glm , ranger , xgboost , or custom user-defined models via make_model() . Installation # Install from CRAN install.packages ( "predictset" ) # Or install the development version from GitHub # install.packages("devtools") devtools :: install_github ( "charlescoverdale/predictset" ) library (predictset) # Get 90% prediction intervals around any model - 3 lines of code result <- conformal_split (x, y, model = y ~ ., x_new = x_new, alpha = 0.10 ) result $ lower # lower bounds result $ upper # upper bounds What is conformal prediction? Standard machine learning models produce point predictions: a single number for regression, a single class for classification. But in practice, you almost always need to know how uncertain that prediction is. Conformal prediction is a framework for wrapping any model in a layer of calibrated uncertainty quantification. Given a target coverage level (say 90%), it produces prediction intervals or prediction sets that are guaranteed to contain the true value at least 90% of the time, regardless of the underlying model or data distribution. The key property is that this guarantee holds in finite samples. It’s not asymptotic, and it doesn’t require distributional assumptions. The only requirement is that the calibration data and test data are exchangeable (roughly: drawn from the same distribution). This makes conformal prediction fundamentally different from parametric confidence intervals, bootstrap intervals, or Bayesian credible intervals, all of which depend on modelling assumptions that may not hold. predictset implements the main conformal methods from the recent literature (split conformal, Jackknife+, CV+, conformalized quantile regression for regression, and APS, RAPS, and LAC for classification) in a lightweight package with only two dependencies ( cli and stats ). How does predictset compare to other packages? Feature predictset probably conformalInference MAPIE Language R R R Python Regression Yes Yes Yes Yes Classification Yes No No Yes Model-agnostic Yes tidymodels only Yes scikit-learn only On CRAN Pending Yes No (GitHub only) N/A Jackknife+ / CV+ Yes No Yes Yes CQR Yes Yes Yes Yes APS / RAPS Yes No No Yes Mondrian CP Yes No No Yes Weighted CP Yes No No Yes Adaptive CI Yes No No No Conditional diagnostics Yes No No Partial Dependencies 2 14+ 5 N/A Last updated 2026 2024 2019 2024 predictset is designed to complement rather than compete with probably . If you’re working in the tidymodels ecosystem and only need regression intervals, probably integrates neatly with your workflow. predictset fills the gaps: classification methods (APS, RAPS, LAC), Jackknife+/CV+ for regression, and a model-agnostic interface that works with any model, not just tidymodels workflows. conformalInference by Ryan Tibshirani was foundational research code, but it hasn’t been updated since 2019, isn’t on CRAN, and doesn’t cover classification. Quick start Regression: prediction intervals with coverage verification library (predictset) set.seed ( 42 ) n <- 500 x <- matrix ( rnorm (n * 5 ), ncol = 5 ) y <- x[, 1 ] * 2 + x[, 2 ] + rnorm (n) x_new <- matrix ( rnorm ( 100 * 5 ), ncol = 5 ) y_new <- x_new[, 1 ] * 2 + x_new[, 2 ] + rnorm ( 100 ) # true values (for evaluation) # Fit conformal intervals result <- conformal_split (x, y, model = y ~ ., x_new = x_new, alpha = 0.10 ) print (result) #> ── Conformal Prediction Intervals (Split Conformal) ── #> • Coverage target: "90%" #> • Training: 250 | Calibration: 250 | Predictions: 100 #> • Conformal quantile: 1.876 #> • Median interval width: 3.7519 # Extract intervals as a data frame head ( data.frame ( pred = result $ pred, lower = result $ lower, upper = result $ upper)) # Verify coverage: should be ≥ 90% coverage (result, y_new) # Predict on new data later (fit once, predict many times) future_data <- matrix ( rnorm ( 50 * 5 ), ncol = 5 ) predict (result, newdata = future_data) Classification: prediction sets set.seed ( 42 ) n <- 400 x <- matrix ( rnorm (n * 4 ), ncol = 4 ) y <- factor ( ifelse (x[, 1 ] + x[, 2 ] > 0 , "A" , "B" )) x_new <- matrix ( rnorm ( 50 * 4 ), ncol = 4 ) clf <- make_model ( train_fun = function (x, y) glm (y ~ ., data = data.frame ( y = y, x), family = "binomial" ), predict_fun = function (object, x_new) { df <- as.data.frame (x_new) names (df) <- paste0 ( "X" , seq_len ( ncol (x_new))) p <- predict (object, newdata = df,
reference_manual_html
Reference manual HTML
CRAN · 0.3.0 · Documentation · text/html · 81,098 · 2026-05-07
Title
Help for package predictset
Label
Reference manual HTML
Text content
Text content
Help for package predictset const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {predictset} Contents predictset-package conformal_aci conformal_aps conformal_class_split conformal_compare conformal_cqr conformal_cv conformal_jackknife conformal_lac conformal_mondrian conformal_mondrian_class conformal_pvalue conformal_raps conformal_split conformal_weighted coverage coverage_by_bin coverage_by_group interval_width make_model plot.predictset_aci plot.predictset_class plot.predictset_reg predict.predictset_class predict.predictset_reg print.predictset_aci print.predictset_class print.predictset_model print.predictset_reg set_size summary.predictset_class summary.predictset_reg Title: Conformal Prediction and Uncertainty Quantification Version: 0.3.0 Description: Implements conformal prediction methods for constructing prediction intervals (regression) and prediction sets (classification) with finite-sample coverage guarantees. Methods include split conformal, 'CV+' and 'Jackknife+' (Barber et al. 2021) < doi:10.1214/20-AOS1965 >, 'Conformalized Quantile Regression' (Romano et al. 2019) < doi:10.48550/arXiv.1905.03222 >, 'Adaptive Prediction Sets' (Romano, Sesia, Candes 2020) < doi:10.48550/arXiv.2006.02544 >, 'Regularized Adaptive Prediction Sets' (Angelopoulos et al. 2021) < doi:10.48550/arXiv.2009.14193 >, Mondrian conformal prediction for group-conditional coverage (Vovk et al. 2005), weighted conformal prediction for covariate shift (Tibshirani et al. 2019), and adaptive conformal inference for sequential prediction (Gibbs and Candes 2021). All methods are distribution-free and provide calibrated uncertainty quantification without parametric assumptions. Works with any model that can produce predictions from new data, including 'lm', 'glm', 'ranger', 'xgboost', and custom user-defined models. License: MIT + file LICENSE Encoding: UTF-8 Language: en-US URL: https://github.com/charlescoverdale/predictset BugReports: https://github.com/charlescoverdale/predictset/issues RoxygenNote: 7.3.3 Depends: R (≥ 4.1.0) Imports: cli (≥ 3.6.0), grDevices, graphics, stats Suggests: testthat (≥ 3.0.0), ranger, ggplot2, knitr, rmarkdown, parsnip (≥ 1.0.0), probably, rsample, workflows VignetteBuilder: knitr Config/testthat/edition: 3 NeedsCompilation: no Packaged: 2026-03-14 17:10:13 UTC; charlescoverdale Author: Charles Coverdale [aut, cre, cph] Maintainer: Charles Coverdale <charlesfcoverdale@gmail.com> Repository: CRAN Date/Publication: 2026-03-19 14:50:15 UTC predictset: Conformal Prediction and Uncertainty Quantification Description Implements conformal prediction methods for constructing prediction intervals (regression) and prediction sets (classification) with finite-sample coverage guarantees. Methods include split conformal, 'CV+' and 'Jackknife+' (Barber et al. 2021) doi:10.1214/20-AOS1965 , 'Conformalized Quantile Regression' (Romano et al. 2019) doi:10.48550/arXiv.1905.03222 , 'Adaptive Prediction Sets' (Romano, Sesia, Candes 2020) doi:10.48550/arXiv.2006.02544 , 'Regularized Adaptive Prediction Sets' (Angelopoulos et al. 2021) doi:10.48550/arXiv.2009.14193 , Mondrian conformal prediction for group-conditional coverage (Vovk et al. 2005), weighted conformal prediction for covariate shift (Tibshirani et al. 2019), and adaptive conformal inference for sequential prediction (Gibbs and Candes 2021). All methods are distribution-free and provide calibrated uncertainty quantification without parametric assumptions. Works with any model that can produce predictions from new data, including 'lm', 'glm', 'ranger', 'xgboost', and custom user-defined models. Author(s) Maintainer : Charles Coverdale charlesfcoverdale@gmail.com [copyright holder] See Also Useful links: https://github.com/charlescoverdale/predictset Report bugs at https://github.com/charlescoverdale/predictset/issues Adaptive Conformal Inference Description Implements basic Adaptive Conformal Inference (ACI) for sequential prediction. The miscoverage level alpha is adjusted online based on whether previous predictions covered the true values, maintaining long-run coverage even under distribution shift. Usage conformal_aci(y_pred, y_true, alpha = 0.1, gamma = 0.005) Arguments y_pred A numeric vector of point predictions (sequential). y_true A numeric vector of true values (sequential). alpha Target miscoverage level. Default 0.10 . gamma Learning rate for alpha adjustment. Default 0.005 . Larger values adapt faster but are less stable. Details ACI provides asymptotic coverage guarantees under distribution drift, not the finite-sample guarantees of split conformal prediction. The long-run average coverage converges to 1 - \alpha as the sequence length grows (Gibbs and Candes, 2021). Value A list with components: lower Numeric vector of lower bounds. upper Numeric vector of upper bounds. covered Logical vector indicating whether each interval covered the true value. alphas Numeric vector of the adapted alpha values at each step. coverage Overall empirical coverage. References Gibbs, I. and Candes, E. (2021). Adaptive conformal inference under distribution shift. Advances in Neural Information Processing Systems , 34. See Also Other regression methods: conformal_cqr () , conformal_cv () , conformal_jackknife () , conformal_mondrian () , conformal_split () , conformal_weighted () Examples set.seed(42) n <- 200 y_true <- cumsum(rnorm(n, sd = 0.1)) + rnorm(n) y_pred <- c(0, y_true[-n]) # naive lag-1 prediction result <- conformal_aci(y_pred, y_true, alpha = 0.10, gamma = 0.01) print(result$coverage) Adaptive Prediction Sets Description Constructs prediction sets using the Adaptive Prediction Sets (APS) method of Romano, Sesia, and Candes (2020). Classes are included in order of decreasing predicted probability until the cumulative probability exceeds the conformal threshold. Usage conformal_aps( x, y, model, x_new, alpha = 0.1, cal_fraction = 0.5, randomize = FALSE, seed = NULL ) Arguments x A numeric matrix or data frame of predictor variables. y A factor (or character/integer vector coerced to factor) of class labels. model A make_model() specification with type = "classification" , or a fitted model object that produces class probabilities. x_new A numeric matrix or data frame of new predictor variables. alpha Miscoverage level. Default 0.10 gives 90 percent prediction sets. cal_fraction Fraction of data used for calibration. Default 0.5 . randomize Logical. If TRUE , uses randomized scores for exact coverage (but prediction sets become stochastic). Default FALSE . seed Optional random seed. Details When randomize = FALSE (the default), this implementation uses the deterministic variant of APS, which provides conservative coverage (at least 1 - \alpha ). The randomized variant ( randomize = TRUE ) achieves exact 1 - \alpha coverage but produces non-reproducible prediction sets. Value A predictset_class object. See conformal_lac() for details. The method component is "aps" . References Romano, Y., Sesia, M. and Candes, E.J. (2020). Classification with valid and adaptive coverage. Advances in Neural Information Processing Systems , 33. doi:10.48550/arXiv.2006.02544 See Also Other classification methods: conformal_lac () , conformal_mondrian_class () , conformal_raps () Examples set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(sample(c("A", "B", "C"), n, replace = TRUE)) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) { df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = p / 2, B = p / 2, C = 1 - p) }, type = "classification" ) result <- conformal
section
predictset.pdf
CRAN · 0.3.0 · Documentation · application/pdf · 199,574 · 2026-05-07
Title
predictset.pdf
Label
predictset.pdf

Reference for predictset (0.3.0)

32개 topic
conformal_aci
Adaptive Conformal Inference
CRAN · 0.3.0 · predictset/man/conformal_aci.Rd · 2026-05-07

Implements basic Adaptive Conformal Inference (ACI) for sequential prediction. The miscoverage level alpha is adjusted online based on whether previous predictions covered the true values, maintaining long-run coverage even under distribution shift.

Aliases
conformal_aci
Concepts
regression methods
Usage
conformal_aci(y_pred, y_true, alpha = 0.1, gamma = 0.005)
Arguments
y_pred
A numeric vector of point predictions (sequential).
y_true
A numeric vector of true values (sequential).
alpha
Target miscoverage level. Default 0.10.
gamma
Learning rate for alpha adjustment. Default 0.005. Larger values adapt faster but are less stable.
Details
ACI provides asymptotic coverage guarantees under distribution drift, not the finite-sample guarantees of split conformal prediction. The long-run average coverage converges to 1 - as the sequence length grows (Gibbs and Candes, 2021).
Value
A list with components: lowerNumeric vector of lower bounds. upperNumeric vector of upper bounds. coveredLogical vector indicating whether each interval covered the true value. alphasNumeric vector of the adapted alpha values at each step. coverageOverall empirical coverage.
Examples
set.seed(42) n <- 200 y_true <- cumsum(rnorm(n, sd = 0.1)) + rnorm(n) y_pred <- c(0, y_true[-n]) # naive lag-1 prediction result <- conformal_aci(y_pred, y_true, alpha = 0.10, gamma = 0.01) print(result$coverage)
See also
Other regression methods: conformal_cqr(), conformal_cv(), conformal_jackknife(), conformal_mondrian(), conformal_split(), conformal_weighted()
References
Gibbs, I. and Candes, E. (2021). Adaptive conformal inference under distribution shift. Advances in Neural Information Processing Systems, 34.
conformal_aps
Adaptive Prediction Sets
CRAN · 0.3.0 · predictset/man/conformal_aps.Rd · 2026-05-07

Constructs prediction sets using the Adaptive Prediction Sets (APS) method of Romano, Sesia, and Candes (2020). Classes are included in order of decreasing predicted probability until the cumulative probability exceeds the conformal threshold.

Aliases
conformal_aps
Concepts
classification methods
Usage
conformal_aps( x, y, model, x_new, alpha = 0.1, cal_fraction = 0.5, randomize = FALSE, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A factor (or character/integer vector coerced to factor) of class labels.
model
A [=make_model]make_model() specification with type = "classification", or a fitted model object that produces class probabilities.
x_new
A numeric matrix or data frame of new predictor variables.
alpha
Miscoverage level. Default 0.10 gives 90 percent prediction sets.
cal_fraction
Fraction of data used for calibration. Default 0.5.
randomize
Logical. If TRUE, uses randomized scores for exact coverage (but prediction sets become stochastic). Default FALSE.
seed
Optional random seed.
Details
When randomize = FALSE (the default), this implementation uses the deterministic variant of APS, which provides conservative coverage (at least 1 - ). The randomized variant (randomize = TRUE) achieves exact 1 - coverage but produces non-reproducible prediction sets.
Value
A predictset_class object. See [=conformal_lac]conformal_lac() for details. The method component is "aps".
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(sample(c("A", "B", "C"), n, replace = TRUE)) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = p / 2, B = p / 2, C = 1 - p) , type = "classification" ) result <- conformal_aps(x, y, model = clf, x_new = x_new) print(result)
See also
Other classification methods: conformal_lac(), conformal_mondrian_class(), conformal_raps()
References
Romano, Y., Sesia, M. and Candes, E.J. (2020). Classification with valid and adaptive coverage. Advances in Neural Information Processing Systems, 33. 10.48550/arXiv.2006.02544
conformal_class_split
Split Conformal Prediction Sets for Classification
CRAN · 0.3.0 · predictset/man/conformal_class_split.Rd · 2026-05-07

[Deprecated] conformal_class_split() is identical to [=conformal_lac]conformal_lac() and is deprecated. Use [=conformal_lac]conformal_lac() instead.

Aliases
conformal_class_split
Usage
conformal_class_split( x, y, model, x_new, alpha = 0.1, cal_fraction = 0.5, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A factor (or character/integer vector coerced to factor) of class labels.
model
A [=make_model]make_model() specification with type = "classification", or a fitted model object that produces class probabilities.
x_new
A numeric matrix or data frame of new predictor variables.
alpha
Miscoverage level. Default 0.10 gives 90 percent prediction sets.
cal_fraction
Fraction of data used for calibration. Default 0.5.
seed
Optional random seed.
Value
A predictset_class object. See [=conformal_lac]conformal_lac() for details.
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(ifelse(x[,1] + x[,2] > 0, "A", "B")) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) df <- data.frame(y = y, x) glm(y ~ ., data = df, family = "binomial") , predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = 1 - p, B = p) , type = "classification" ) suppressWarnings( result <- conformal_class_split(x, y, model = clf, x_new = x_new) )
References
Sadinle, M., Lei, J. and Wasserman, L. (2019). Least ambiguous set-valued classifiers with bounded error levels. Journal of the American Statistical Association, 114(525), 223-234. 10.1080/01621459.2017.1395341
conformal_compare
Compare Conformal Prediction Methods
CRAN · 0.3.0 · predictset/man/conformal_compare.Rd · 2026-05-07

Runs multiple conformal prediction methods on the same data and returns a comparison data frame with coverage, interval width, and computation time for each method.

Aliases
conformal_compare
Concepts
diagnostics
Usage
conformal_compare( x, y, model, x_new, y_new, methods = c("split", "cv"), alpha = 0.1, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A numeric vector of response values.
model
A fitted model object, a [=make_model]make_model() specification, or a formula.
x_new
A numeric matrix or data frame of new predictor variables.
y_new
A numeric vector of true response values for x_new, used to compute empirical coverage.
methods
Character vector of method names to compare. Default c("split", "cv"). Available methods: "split", "cv", "jackknife", "jackknife_basic".
alpha
Miscoverage level. Default 0.10.
seed
Optional random seed.
Value
A predictset_compare object (a data frame) with columns: methodCharacter. The method name. coverageNumeric. Empirical coverage on y_new. mean_widthNumeric. Mean interval width. median_widthNumeric. Median interval width. time_secondsNumeric. Elapsed time in seconds.
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(100 * 3), ncol = 3) y_new <- x_new[, 1] * 2 + rnorm(100) comp <- conformal_compare(x, y, model = y ~ ., x_new = x_new, y_new = y_new) print(comp)
See also
Other diagnostics: conformal_pvalue(), coverage(), coverage_by_bin(), coverage_by_group(), interval_width(), set_size()
conformal_cqr
Conformalized Quantile Regression
CRAN · 0.3.0 · predictset/man/conformal_cqr.Rd · 2026-05-07

Constructs prediction intervals using Conformalized Quantile Regression (Romano et al. 2019). Requires two models: one for the lower quantile and one for the upper quantile. The conformal step adjusts these quantile predictions to achieve valid coverage.

Aliases
conformal_cqr
Concepts
regression methods
Usage
conformal_cqr( x, y, model_lower, model_upper, x_new, alpha = 0.1, cal_fraction = 0.5, quantiles = c(0.05, 0.95), seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A numeric vector of response values.
model_lower
A [=make_model]make_model() specification for the lower quantile model.
model_upper
A [=make_model]make_model() specification for the upper quantile model.
x_new
A numeric matrix or data frame of new predictor variables.
alpha
Miscoverage level. Default 0.10.
cal_fraction
Fraction of data used for calibration. Default 0.5.
quantiles
The target quantiles. Default c(0.05, 0.95).
seed
Optional random seed.
Details
Interval quality depends on the underlying quantile models. Poorly calibrated quantile models produce valid but potentially wide intervals. For best results, use proper quantile regression models (e.g. quantreg::rq()) rather than shifted mean predictions.
Value
A predictset_reg object. See [=conformal_split]conformal_split() for details. The method component is "cqr".
Examples
set.seed(42) n <- 200 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(20 * 3), ncol = 3) # Approximating quantile regression with shifted linear models. # In practice, use quantile regression models, e.g.: # quantreg::rq(y ~ ., data = df, tau = 0.05) model_lo <- make_model( train_fun = function(x, y) lm(y ~ ., data = data.frame(y = y, x)), predict_fun = function(obj, x_new) predict(obj, newdata = as.data.frame(x_new)) - 1.5 , type = "regression" ) model_hi <- make_model( train_fun = function(x, y) lm(y ~ ., data = data.frame(y = y, x)), predict_fun = function(obj, x_new) predict(obj, newdata = as.data.frame(x_new)) + 1.5 , type = "regression" ) result <- conformal_cqr(x, y, model_lo, model_hi, x_new = x_new) print(result)
See also
Other regression methods: conformal_aci(), conformal_cv(), conformal_jackknife(), conformal_mondrian(), conformal_split(), conformal_weighted()
References
Romano, Y., Patterson, E. and Candes, E.J. (2019). Conformalized quantile regression. Advances in Neural Information Processing Systems, 32. 10.48550/arXiv.1905.03222
conformal_cv
CV+ Conformal Prediction Intervals
CRAN · 0.3.0 · predictset/man/conformal_cv.Rd · 2026-05-07

Constructs prediction intervals using the CV+ method of Barber et al. (2021). Cross-validation residuals and fold-specific models are used to form observation-specific prediction intervals with finite-sample coverage guarantees.

Aliases
conformal_cv
Concepts
regression methods
Usage
conformal_cv( x, y, model, x_new = NULL, alpha = 0.1, n_folds = 10, verbose = FALSE, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A numeric vector of response values.
model
A fitted model object (e.g., from [=lm]lm()), a [=make_model]make_model() specification, or a formula (which will fit a linear model).
x_new
A numeric matrix or data frame of new predictor variables. If NULL, intervals are computed for the training data using leave-one-fold-out predictions. Note: when x_new = NULL, prediction intervals for training observations use a self-consistent approximation. For exact CV+ intervals on new data, provide x_new.
alpha
Miscoverage level. Default 0.10 gives 90 percent prediction intervals.
n_folds
Number of cross-validation folds. Default 10.
verbose
Logical. If TRUE, shows a progress bar during fold fitting. Default FALSE.
seed
Optional random seed for reproducible data splitting.
Details
Unlike basic CV conformal prediction (which computes a single quantile of CV residuals), CV+ constructs intervals that vary per test point. For each test point, every training observation contributes a lower and upper value based on the fold model that excluded that observation, evaluated at the test point, plus or minus the leave-fold-out residual for that observation. The interval bounds are then taken as quantiles of these per-observation values. The CV+ theoretical coverage guarantee is 1 - 2, not 1 - (Barber et al. 2021, Theorem 2). This is weaker than split conformal's 1 - guarantee. In practice, CV+ coverage is typically much closer to 1 - .
Value
A predictset_reg object. See [=conformal_split]conformal_split() for details. The method component is "cv_plus". The object also stores fold_models (list of K fitted models), fold_ids (integer vector mapping each observation to its fold), and residuals (leave-fold-out absolute residuals), which are needed by the [=predict]predict() method to compute CV+ intervals for new data.
Examples
set.seed(42) n <- 200 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(20 * 3), ncol = 3) result <- conformal_cv(x, y, model = y ~ ., x_new = x_new, n_folds = 5) print(result)
See also
Other regression methods: conformal_aci(), conformal_cqr(), conformal_jackknife(), conformal_mondrian(), conformal_split(), conformal_weighted()
References
Barber, R.F., Candes, E.J., Ramdas, A. and Tibshirani, R.J. (2021). Predictive inference with the Jackknife+. Annals of Statistics, 49(1), 486-507. 10.1214/20-AOS1965
conformal_jackknife
Jackknife+ Conformal Prediction Intervals
CRAN · 0.3.0 · predictset/man/conformal_jackknife.Rd · 2026-05-07

Constructs prediction intervals using the Jackknife+ method of Barber et al. (2021). Uses leave-one-out models to form prediction intervals with finite-sample coverage guarantees.

Aliases
conformal_jackknife
Concepts
regression methods
Usage
conformal_jackknife( x, y, model, x_new = NULL, alpha = 0.1, plus = TRUE, verbose = FALSE, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A numeric vector of response values.
model
A fitted model object (e.g., from [=lm]lm()), a [=make_model]make_model() specification, or a formula (which will fit a linear model).
x_new
A numeric matrix or data frame of new predictor variables. If NULL, intervals are computed for the training data.
alpha
Miscoverage level. Default 0.10 gives 90 percent prediction intervals.
plus
Logical. If TRUE (default), uses the Jackknife+ method. If FALSE, uses the basic jackknife.
verbose
Logical. If TRUE, shows a progress bar during LOO fitting. Default FALSE.
seed
Optional random seed for reproducible data splitting.
Details
The Jackknife+ method fits n leave-one-out models and uses each model's prediction at the test point, shifted by the corresponding LOO residual, to construct the interval. This is distinct from basic jackknife, which centres a single full-model prediction and adds a quantile of the LOO residuals. The Jackknife+ theoretical coverage guarantee is 1 - 2, not 1 - (Barber et al. 2021, Theorem 1). This is weaker than split conformal's 1 - guarantee. In practice, Jackknife+ coverage is typically much closer to 1 - .
Value
A predictset_reg object. See [=conformal_split]conformal_split() for details. The method component is "jackknife_plus" or "jackknife". Additional components include loo_models (list of n leave-one-out fitted models) and loo_residuals (numeric vector of LOO absolute residuals).
Examples
set.seed(42) n <- 50 x <- matrix(rnorm(n * 2), ncol = 2) y <- x[, 1] + rnorm(n) x_new <- matrix(rnorm(10 * 2), ncol = 2) result <- conformal_jackknife(x, y, model = y ~ ., x_new = x_new) print(result)
See also
Other regression methods: conformal_aci(), conformal_cqr(), conformal_cv(), conformal_mondrian(), conformal_split(), conformal_weighted()
References
Barber, R.F., Candes, E.J., Ramdas, A. and Tibshirani, R.J. (2021). Predictive inference with the jackknife+. Annals of Statistics, 49(1), 486--507.
conformal_lac
Least Ambiguous Classifier Prediction Sets
CRAN · 0.3.0 · predictset/man/conformal_lac.Rd · 2026-05-07

Constructs prediction sets using the Least Ambiguous Classifier (LAC) method. Includes all classes whose predicted probability exceeds 1 - q, where q is the conformal quantile of 1 - p(true class) scores.

Aliases
conformal_lac
Concepts
classification methods
Usage
conformal_lac(x, y, model, x_new, alpha = 0.1, cal_fraction = 0.5, seed = NULL)
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A factor (or character/integer vector coerced to factor) of class labels.
model
A [=make_model]make_model() specification with type = "classification", or a fitted model object that produces class probabilities.
x_new
A numeric matrix or data frame of new predictor variables.
alpha
Miscoverage level. Default 0.10 gives 90 percent prediction sets.
cal_fraction
Fraction of data used for calibration. Default 0.5.
seed
Optional random seed.
Value
A predictset_class object with components: setsA list of character vectors, one per new observation. probsA list of named numeric vectors with predicted probabilities for included classes. alphaThe miscoverage level used. methodCharacter string "lac". scoresNumeric vector of calibration scores. quantileThe conformal quantile used. classesCharacter vector of all class labels. n_calNumber of calibration observations. n_trainNumber of training observations. fitted_modelThe fitted model object. modelThe predictset_model specification.
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(ifelse(x[,1] + x[,2] > 0, "A", "B")) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = 1 - p, B = p) , type = "classification" ) result <- conformal_lac(x, y, model = clf, x_new = x_new) print(result)
See also
Other classification methods: conformal_aps(), conformal_mondrian_class(), conformal_raps()
References
Sadinle, M., Lei, J. and Wasserman, L. (2019). Least ambiguous set-valued classifiers with bounded error levels. Journal of the American Statistical Association, 114(525), 223-234. 10.1080/01621459.2017.1395341
conformal_mondrian
Mondrian Conformal Prediction Intervals (Group-Conditional)
CRAN · 0.3.0 · predictset/man/conformal_mondrian.Rd · 2026-05-07

Constructs prediction intervals with group-conditional coverage guarantees. Instead of a single conformal quantile, a separate quantile is computed for each group, ensuring coverage within each subgroup (e.g. by gender, region, or model type).

Aliases
conformal_mondrian
Concepts
regression methods
Usage
conformal_mondrian( x, y, model, x_new, groups, groups_new, alpha = 0.1, cal_fraction = 0.5, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A numeric vector of response values.
model
A fitted model object, a [=make_model]make_model() specification, or a formula.
x_new
A numeric matrix or data frame of new predictor variables.
groups
A factor or character vector of group labels for each observation in x, with length equal to nrow(x).
groups_new
A factor or character vector of group labels for each observation in x_new, with length equal to nrow(x_new).
alpha
Miscoverage level. Default 0.10.
cal_fraction
Fraction of data used for calibration. Default 0.5.
seed
Optional random seed.
Value
A predictset_reg object. See [=conformal_split]conformal_split() for details. The method component is "mondrian". Additional components include groups_new (the group labels for new data) and group_quantiles (named numeric vector of per-group conformal quantiles).
Examples
set.seed(42) n <- 400 x <- matrix(rnorm(n * 3), ncol = 3) groups <- factor(ifelse(x[, 1] > 0, "high", "low")) y <- x[, 1] * 2 + ifelse(groups == "high", 2, 0.5) * rnorm(n) x_new <- matrix(rnorm(50 * 3), ncol = 3) groups_new <- factor(ifelse(x_new[, 1] > 0, "high", "low")) result <- conformal_mondrian(x, y, model = y ~ ., x_new = x_new, groups = groups, groups_new = groups_new) print(result)
See also
Other regression methods: conformal_aci(), conformal_cqr(), conformal_cv(), conformal_jackknife(), conformal_split(), conformal_weighted()
References
Vovk, V., Gammerman, A. and Shafer, G. (2005). Algorithmic Learning in a Random World. Springer.
conformal_mondrian_class
Mondrian Conformal Prediction Sets for Classification
CRAN · 0.3.0 · predictset/man/conformal_mondrian_class.Rd · 2026-05-07

Constructs prediction sets with group-conditional coverage guarantees for classification. Uses LAC-style scoring with per-group conformal quantiles.

Aliases
conformal_mondrian_class
Concepts
classification methods
Usage
conformal_mondrian_class( x, y, model, x_new, groups, groups_new, alpha = 0.1, cal_fraction = 0.5, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A factor (or character/integer vector coerced to factor) of class labels.
model
A [=make_model]make_model() specification with type = "classification", or a fitted model object.
x_new
A numeric matrix or data frame of new predictor variables.
groups
A factor or character vector of group labels for each observation in x.
groups_new
A factor or character vector of group labels for each observation in x_new.
alpha
Miscoverage level. Default 0.10.
cal_fraction
Fraction of data used for calibration. Default 0.5.
seed
Optional random seed.
Value
A predictset_class object. See [=conformal_lac]conformal_lac() for details. The method component is "mondrian". Additional components include groups_new and group_quantiles.
Examples
set.seed(42) n <- 400 x <- matrix(rnorm(n * 4), ncol = 4) groups <- factor(ifelse(x[, 1] > 0, "high", "low")) y <- factor(ifelse(x[,1] + x[,2] > 0, "A", "B")) x_new <- matrix(rnorm(50 * 4), ncol = 4) groups_new <- factor(ifelse(x_new[, 1] > 0, "high", "low")) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = 1 - p, B = p) , type = "classification" ) result <- conformal_mondrian_class(x, y, model = clf, x_new = x_new, groups = groups, groups_new = groups_new) print(result)
See also
Other classification methods: conformal_aps(), conformal_lac(), conformal_raps()
conformal_pvalue
Conformal P-Values
CRAN · 0.3.0 · predictset/man/conformal_pvalue.Rd · 2026-05-07

Computes conformal p-values for new observations given calibration nonconformity scores. The p-value indicates how conforming a new observation is relative to the calibration set.

Aliases
conformal_pvalue
Concepts
diagnostics
Usage
conformal_pvalue(scores, new_scores)
Arguments
scores
A numeric vector of calibration nonconformity scores.
new_scores
A numeric vector of nonconformity scores for new observations.
Value
A numeric vector of p-values, one per element of new_scores. Each p-value is in (0, 1].
Examples
# Calibration scores from a conformal split set.seed(42) cal_scores <- abs(rnorm(100)) new_scores <- abs(rnorm(5)) pvals <- conformal_pvalue(cal_scores, new_scores) print(pvals)
See also
Other diagnostics: conformal_compare(), coverage(), coverage_by_bin(), coverage_by_group(), interval_width(), set_size()
conformal_raps
Regularized Adaptive Prediction Sets
CRAN · 0.3.0 · predictset/man/conformal_raps.Rd · 2026-05-07

Constructs prediction sets using the Regularized Adaptive Prediction Sets (RAPS) method of Angelopoulos et al. (2021). Extends APS with a regularization penalty that encourages smaller prediction sets.

Aliases
conformal_raps
Concepts
classification methods
Usage
conformal_raps( x, y, model, x_new, alpha = 0.1, cal_fraction = 0.5, k_reg = 1, lambda = 0.01, randomize = FALSE, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A factor (or character/integer vector coerced to factor) of class labels.
model
A [=make_model]make_model() specification with type = "classification", or a fitted model object that produces class probabilities.
x_new
A numeric matrix or data frame of new predictor variables.
alpha
Miscoverage level. Default 0.10 gives 90 percent prediction sets.
cal_fraction
Fraction of data used for calibration. Default 0.5.
k_reg
Regularization parameter controlling the number of classes exempt from the penalty. Default 1 (only the top class is unpenalized).
lambda
Regularization strength. Default 0.01. Larger values produce smaller prediction sets at the potential cost of coverage.
randomize
Logical. If TRUE, uses randomized scores for exact coverage (but prediction sets become stochastic). Default FALSE.
seed
Optional random seed.
Value
A predictset_class object. See [=conformal_lac]conformal_lac() for details. The method component is "raps".
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(sample(c("A", "B", "C"), n, replace = TRUE)) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = p / 2, B = p / 2, C = 1 - p) , type = "classification" ) result <- conformal_raps(x, y, model = clf, x_new = x_new, k_reg = 1, lambda = 0.01) print(result)
See also
Other classification methods: conformal_aps(), conformal_lac(), conformal_mondrian_class()
References
Angelopoulos, A.N., Bates, S., Malik, J. and Jordan, M.I. (2021). Uncertainty sets for image classifiers using conformal prediction. International Conference on Learning Representations. 10.48550/arXiv.2009.14193
conformal_split
Split Conformal Prediction Intervals
CRAN · 0.3.0 · predictset/man/conformal_split.Rd · 2026-05-07

Constructs prediction intervals using split conformal inference. The data is split into training and calibration sets; nonconformity scores are computed on the calibration set and used to form intervals on new data.

Aliases
conformal_split
Concepts
regression methods
Usage
conformal_split( x, y, model, x_new, alpha = 0.1, cal_fraction = 0.5, score_type = c("absolute", "normalized"), scale_model = NULL, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A numeric vector of response values.
model
A fitted model object (e.g., from [=lm]lm()), a [=make_model]make_model() specification, or a formula (which will fit a linear model).
x_new
A numeric matrix or data frame of new predictor variables for which to compute prediction intervals.
alpha
Miscoverage level. Default 0.10 gives 90 percent prediction intervals.
cal_fraction
Fraction of data used for calibration. Default 0.5.
score_type
Type of nonconformity score. "absolute" (default) uses absolute residuals and produces constant-width intervals. "normalized" divides residuals by a local scale estimate from scale_model, producing locally-adaptive interval widths.
scale_model
A [=make_model]make_model() specification for predicting absolute residuals (used only when score_type = "normalized"). Must return positive predictions. If NULL and score_type = "normalized", a default model is fitted using [=lm]lm() on absolute residuals.
seed
Optional random seed for reproducible data splitting.
Value
A predictset_reg object (a list) with components: predNumeric vector of point predictions for x_new. lowerNumeric vector of lower bounds. upperNumeric vector of upper bounds. alphaThe miscoverage level used. methodCharacter string "split". scoresNumeric vector of calibration nonconformity scores. quantileThe conformal quantile used to form intervals. n_calNumber of calibration observations. n_trainNumber of training observations. fitted_modelThe fitted model object. modelThe predictset_model specification.
Examples
set.seed(42) n <- 200 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(50 * 3), ncol = 3) result <- conformal_split(x, y, model = y ~ ., x_new = x_new) print(result)
See also
Other regression methods: conformal_aci(), conformal_cqr(), conformal_cv(), conformal_jackknife(), conformal_mondrian(), conformal_weighted()
References
Lei, J., G'Sell, M., Rinaldo, A., Tibshirani, R.J. and Wasserman, L. (2018). Distribution-free predictive inference for regression. Journal of the American Statistical Association, 113(523), 1094-1111. 10.1080/01621459.2017.1307116
conformal_weighted
Weighted Conformal Prediction Intervals
CRAN · 0.3.0 · predictset/man/conformal_weighted.Rd · 2026-05-07

Constructs prediction intervals using weighted split conformal inference, designed for settings with covariate shift where calibration and test data may have different distributions. Importance weights re-weight the calibration scores to account for this shift.

Aliases
conformal_weighted
Concepts
regression methods
Usage
conformal_weighted( x, y, model, x_new, weights = NULL, alpha = 0.1, cal_fraction = 0.5, seed = NULL )
Arguments
x
A numeric matrix or data frame of predictor variables.
y
A numeric vector of response values.
model
A fitted model object, a [=make_model]make_model() specification, or a formula.
x_new
A numeric matrix or data frame of new predictor variables.
weights
A numeric vector of importance weights for each observation in x, with length equal to nrow(x). Weights must be non-negative. If NULL, uniform weights are used (equivalent to standard split conformal).
alpha
Miscoverage level. Default 0.10.
cal_fraction
Fraction of data used for calibration. Default 0.5.
seed
Optional random seed.
Details
The test-point weight w_n+1 is set to the mean of calibration weights, following standard practice when the true test weight is unknown. See Tibshirani et al. (2019), Equation 5.
Value
A predictset_reg object. See [=conformal_split]conformal_split() for details. The method component is "weighted".
Examples
set.seed(42) n <- 400 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(50 * 3, mean = 1), ncol = 3) weights <- rep(1, n) result <- conformal_weighted(x, y, model = y ~ ., x_new = x_new, weights = weights) print(result)
See also
Other regression methods: conformal_aci(), conformal_cqr(), conformal_cv(), conformal_jackknife(), conformal_mondrian(), conformal_split()
References
Tibshirani, R.J., Barber, R.F., Candes, E.J. and Ramdas, A. (2019). Conformal prediction under covariate shift. Advances in Neural Information Processing Systems, 32.
coverage
Empirical Coverage Rate
CRAN · 0.3.0 · predictset/man/coverage.Rd · 2026-05-07

Computes the fraction of true values that fall within the prediction intervals (regression) or prediction sets (classification).

Aliases
coveragecoverage.predictset_regcoverage.predictset_class
Concepts
diagnostics
Usage
coverage(object, y_true) coveragepredictset_reg(object, y_true) coveragepredictset_class(object, y_true)
Arguments
object
A predictset_reg or predictset_class object.
y_true
A numeric vector (regression) or factor/character vector (classification) of true values, with the same length as the number of predictions.
Value
A single numeric value between 0 and 1 representing the empirical coverage rate.
Examples
set.seed(42) n <- 500 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(100 * 3), ncol = 3) y_new <- x_new[, 1] * 2 + rnorm(100) result <- conformal_split(x, y, model = y ~ ., x_new = x_new) coverage(result, y_new)
See also
Other diagnostics: conformal_compare(), conformal_pvalue(), coverage_by_bin(), coverage_by_group(), interval_width(), set_size()
coverage_by_bin
Empirical Coverage by Prediction Bin
CRAN · 0.3.0 · predictset/man/coverage_by_bin.Rd · 2026-05-07

Bins predictions into quantile-based groups and computes coverage within each bin. Useful for detecting systematic under- or over-coverage as a function of predicted value.

Aliases
coverage_by_bin
Concepts
diagnostics
Usage
coverage_by_bin(object, y_true, bins = 10)
Arguments
object
A predictset_reg object.
y_true
A numeric vector of true response values.
bins
Number of bins. Default 10.
Value
A data frame with columns bin, coverage, n, and mean_width.
Examples
set.seed(42) n <- 500 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(200 * 3), ncol = 3) y_new <- x_new[, 1] * 2 + rnorm(200) result <- conformal_split(x, y, model = y ~ ., x_new = x_new) coverage_by_bin(result, y_new, bins = 5)
See also
Other diagnostics: conformal_compare(), conformal_pvalue(), coverage(), coverage_by_group(), interval_width(), set_size()
coverage_by_group
Empirical Coverage by Group
CRAN · 0.3.0 · predictset/man/coverage_by_group.Rd · 2026-05-07

Computes empirical coverage within each group, useful for diagnosing conditional coverage violations.

Aliases
coverage_by_group
Concepts
diagnostics
Usage
coverage_by_group(object, y_true, groups)
Arguments
object
A predictset_reg or predictset_class object.
y_true
True values (numeric for regression, factor/character for classification).
groups
A factor or character vector of group labels with the same length as the number of predictions.
Value
A data frame with columns group, coverage, n, and target.
Examples
set.seed(42) n <- 500 x <- matrix(rnorm(n * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(n) x_new <- matrix(rnorm(200 * 3), ncol = 3) y_new <- x_new[, 1] * 2 + rnorm(200) groups <- factor(ifelse(x_new[, 1] > 0, "high", "low")) result <- conformal_split(x, y, model = y ~ ., x_new = x_new) coverage_by_group(result, y_new, groups)
See also
Other diagnostics: conformal_compare(), conformal_pvalue(), coverage(), coverage_by_bin(), interval_width(), set_size()
interval_width
Prediction Interval Widths
CRAN · 0.3.0 · predictset/man/interval_width.Rd · 2026-05-07

Returns the width of each prediction interval.

Aliases
interval_width
Concepts
diagnostics
Usage
interval_width(object)
Arguments
object
A predictset_reg object.
Value
A numeric vector of interval widths.
Examples
set.seed(42) x <- matrix(rnorm(200 * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(200) x_new <- matrix(rnorm(50 * 3), ncol = 3) result <- conformal_split(x, y, model = y ~ ., x_new = x_new) widths <- interval_width(result) summary(widths)
See also
Other diagnostics: conformal_compare(), conformal_pvalue(), coverage(), coverage_by_bin(), coverage_by_group(), set_size()
make_model
Create a Model Specification for Conformal Prediction
CRAN · 0.3.0 · predictset/man/make_model.Rd · 2026-05-07

Defines how to train a model and generate predictions, allowing any model to be used with conformal prediction methods.

Aliases
make_model
Usage
make_model(train_fun, predict_fun, type = c("regression", "classification"))
Arguments
train_fun
A function with signature function(x, y) that takes a numeric matrix x and response y (numeric for regression, factor for classification) and returns a fitted model object.
predict_fun
A function with signature function(object, x_new) that takes a fitted model object and a numeric matrix x_new and returns predictions. For regression, must return a numeric vector. For classification, must return a probability matrix with columns named by class labels.
type
Character string, either "regression" or "classification".
Value
A predictset_model object (a list with components train_fun, predict_fun, and type).
Examples
reg_model <- make_model( train_fun = function(x, y) lm(y ~ ., data = data.frame(y = y, x)), predict_fun = function(object, x_new) predict(object, newdata = as.data.frame(x_new)) , type = "regression" )
plot.predictset_aci
Plot Method for ACI Objects
CRAN · 0.3.0 · predictset/man/plot.predictset_aci.Rd · 2026-05-07

Creates a two-panel base R plot. The top panel shows prediction intervals over time; the bottom panel shows the adaptive alpha trace.

Aliases
plot.predictset_aci
Usage
plotpredictset_aci(x, max_points = 500, ...)
Arguments
x
A predictset_aci object.
max_points
Maximum number of points to display. Default 500.
...
Additional arguments (currently unused).
Value
The input object, invisibly.
Examples
set.seed(42) n <- 100 y_true <- cumsum(rnorm(n, sd = 0.1)) + rnorm(n) y_pred <- c(0, y_true[-n]) result <- conformal_aci(y_pred, y_true, alpha = 0.10, gamma = 0.01) plot(result)
plot.predictset_class
Plot Method for Classification Conformal Objects
CRAN · 0.3.0 · predictset/man/plot.predictset_class.Rd · 2026-05-07

Creates a barplot showing the distribution of prediction set sizes.

Aliases
plot.predictset_class
Usage
plotpredictset_class(x, ...)
Arguments
x
A predictset_class object.
...
Additional arguments passed to [=barplot]barplot().
Value
The input object, invisibly.
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(ifelse(x[,1] > 0, "A", "B")) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = 1 - p, B = p) , type = "classification" ) result <- conformal_lac(x, y, model = clf, x_new = x_new) plot(result)
plot.predictset_reg
Plot Method for Regression Conformal Objects
CRAN · 0.3.0 · predictset/man/plot.predictset_reg.Rd · 2026-05-07

Creates a base R plot showing prediction intervals. Points are ordered by predicted value, with intervals shown as vertical segments.

Aliases
plot.predictset_reg
Usage
plotpredictset_reg(x, max_points = 200, ...)
Arguments
x
A predictset_reg object.
max_points
Maximum number of points to display. Default 200. If there are more predictions, a random subset is shown.
...
Additional arguments passed to [=plot]plot().
Value
The input object, invisibly.
Examples
set.seed(42) x <- matrix(rnorm(200 * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(200) x_new <- matrix(rnorm(50 * 3), ncol = 3) result <- conformal_split(x, y, model = y ~ ., x_new = x_new) plot(result)
predict.predictset_class
Predict Method for Classification Conformal Objects
CRAN · 0.3.0 · predictset/man/predict.predictset_class.Rd · 2026-05-07

Generate prediction sets for new data using a fitted conformal prediction object.

Aliases
predict.predictset_class
Usage
predictpredictset_class(object, newdata, ...)
Arguments
object
A predictset_class object.
newdata
A numeric matrix or data frame of new predictor variables.
...
Additional arguments. For Mondrian objects, pass groups_new (a factor or character vector of group labels for each observation in newdata).
Value
A predictset_class object with updated sets and probabilities.
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(ifelse(x[,1] > 0, "A", "B")) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = 1 - p, B = p) , type = "classification" ) result <- conformal_lac(x, y, model = clf, x_new = x_new) preds <- predict(result, newdata = matrix(rnorm(5 * 4), ncol = 4))
predict.predictset_reg
Predict Method for Regression Conformal Objects
CRAN · 0.3.0 · predictset/man/predict.predictset_reg.Rd · 2026-05-07

Generate prediction intervals for new data using a fitted conformal prediction object.

Aliases
predict.predictset_reg
Usage
predictpredictset_reg(object, newdata, ...)
Arguments
object
A predictset_reg object.
newdata
A numeric matrix or data frame of new predictor variables.
...
Additional arguments. For Mondrian objects, pass groups_new (a factor or character vector of group labels for each observation in newdata).
Value
A data frame with columns pred, lower, and upper.
Examples
set.seed(42) x <- matrix(rnorm(200 * 3), ncol = 3) y <- x[, 1] * 2 + rnorm(200) x_new <- matrix(rnorm(10 * 3), ncol = 3) result <- conformal_split(x, y, model = y ~ ., x_new = x_new) preds <- predict(result, newdata = matrix(rnorm(5 * 3), ncol = 3))
predictset-package
predictset: Conformal Prediction and Uncertainty Quantification
CRAN · 0.3.0 · package · predictset/man/predictset-package.Rd · 2026-05-07

Implements conformal prediction methods for constructing prediction intervals (regression) and prediction sets (classification) with finite-sample coverage guarantees. Methods include split conformal, 'CV+' and 'Jackknife+' (Barber et al. 2021) 10.1214/20-AOS1965, 'Conformalized Quantile Regression' (Romano et al. 2019) 10.48550/arXiv.1905.03222, 'Adaptive Prediction Sets' (Romano, Sesia, Candes 2020) 10.48550/arXiv.2006.02544, 'Regularized Adaptive Prediction Sets' (Angelopoulos et al. 2021) 10.48550/arXiv.2009.14193, Mondrian conformal prediction for group-conditional coverage (Vovk et al. 2005), weighted conformal prediction for covariate shift (Tibshirani et al. 2019), and adaptive conformal inference for sequential prediction (Gibbs and Candes 2021). All methods are distribution-free and provide calibrated uncertainty quantification without parametric assumptions. Works with any model that can produce predictions from new data, including 'lm', 'glm', 'ranger', 'xgboost', and custom user-defined models.

Aliases
predictsetpredictset-package
Keywords
internal
Concepts
conformal predictioncoverage guaranteedistribution-free inferencemodel-agnosticprediction intervalsprediction setsuncertainty quantification
See also
Useful links: https://github.com/charlescoverdale/predictset Report bugs at https://github.com/charlescoverdale/predictset/issues
Author
Maintainer: Charles Coverdale charlesfcoverdale@gmail.com [copyright holder]
print.predictset_aci
Print Method for ACI Objects
CRAN · 0.3.0 · predictset/man/print.predictset_aci.Rd · 2026-05-07

Print Method for ACI Objects

Aliases
print.predictset_aci
Usage
printpredictset_aci(x, ...)
Arguments
x
A predictset_aci object.
...
Additional arguments (currently unused).
Value
The input object, invisibly.
print.predictset_class
Print Method for Classification Conformal Objects
CRAN · 0.3.0 · predictset/man/print.predictset_class.Rd · 2026-05-07

Print Method for Classification Conformal Objects

Aliases
print.predictset_class
Usage
printpredictset_class(x, ...)
Arguments
x
A predictset_class object.
...
Additional arguments (currently unused).
Value
The input object, invisibly.
print.predictset_model
Print Method for Model Specifications
CRAN · 0.3.0 · predictset/man/print.predictset_model.Rd · 2026-05-07

Print Method for Model Specifications

Aliases
print.predictset_model
Usage
printpredictset_model(x, ...)
Arguments
x
A predictset_model object.
...
Additional arguments (currently unused).
Value
The input object, invisibly.
print.predictset_reg
Print Method for Regression Conformal Objects
CRAN · 0.3.0 · predictset/man/print.predictset_reg.Rd · 2026-05-07

Print Method for Regression Conformal Objects

Aliases
print.predictset_reg
Usage
printpredictset_reg(x, ...)
Arguments
x
A predictset_reg object.
...
Additional arguments (currently unused).
Value
The input object, invisibly.
set_size
Prediction Set Sizes
CRAN · 0.3.0 · predictset/man/set_size.Rd · 2026-05-07

Returns the number of classes in each prediction set.

Aliases
set_size
Concepts
diagnostics
Usage
set_size(object)
Arguments
object
A predictset_class object.
Value
An integer vector of set sizes.
Examples
set.seed(42) n <- 300 x <- matrix(rnorm(n * 4), ncol = 4) y <- factor(ifelse(x[,1] > 0, "A", "B")) x_new <- matrix(rnorm(50 * 4), ncol = 4) clf <- make_model( train_fun = function(x, y) glm(y ~ ., data = data.frame(y = y, x), family = "binomial"), predict_fun = function(object, x_new) df <- as.data.frame(x_new) names(df) <- paste0("X", seq_len(ncol(x_new))) p <- predict(object, newdata = df, type = "response") cbind(A = 1 - p, B = p) , type = "classification" ) result <- conformal_lac(x, y, model = clf, x_new = x_new) sizes <- set_size(result) table(sizes)
See also
Other diagnostics: conformal_compare(), conformal_pvalue(), coverage(), coverage_by_bin(), coverage_by_group(), interval_width()
summary.predictset_class
Summary Method for Classification Conformal Objects
CRAN · 0.3.0 · predictset/man/summary.predictset_class.Rd · 2026-05-07

Summary Method for Classification Conformal Objects

Aliases
summary.predictset_class
Usage
summarypredictset_class(object, ...)
Arguments
object
A predictset_class object.
...
Additional arguments (currently unused).
Value
The input object, invisibly.
summary.predictset_reg
Summary Method for Regression Conformal Objects
CRAN · 0.3.0 · predictset/man/summary.predictset_reg.Rd · 2026-05-07

Summary Method for Regression Conformal Objects

Aliases
summary.predictset_reg
Usage
summarypredictset_reg(object, ...)
Arguments
object
A predictset_reg object.
...
Additional arguments (currently unused).
Value
The input object, invisibly.

버전 이력

RepositoryVersionPublishedFirst seenLast seenDocs
CRAN0.3.02026-05-292026-05-30

보안

표시할 OSV 데이터가 없습니다.

문헌 신호

표시할 OpenAlex 데이터가 없습니다.