{"id":30141307,"url":"https://github.com/smac-group/pcoqs","last_synced_at":"2025-08-11T04:36:45.983Z","repository":{"id":304884361,"uuid":"1020421222","full_name":"SMAC-Group/pcoqs","owner":"SMAC-Group","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-15T22:48:09.000Z","size":1688,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-16T19:31:04.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SMAC-Group.png","metadata":{"files":{"readme":"README.Rmd","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":"2025-07-15T21:00:45.000Z","updated_at":"2025-07-15T22:48:12.000Z","dependencies_parsed_at":"2025-07-17T01:31:19.520Z","dependency_job_id":"fb7a0fa7-688d-439d-ad65-ed1fb0277996","html_url":"https://github.com/SMAC-Group/pcoqs","commit_stats":null,"previous_names":["smac-group/pcoqs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/SMAC-Group/pcoqs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAC-Group%2Fpcoqs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAC-Group%2Fpcoqs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAC-Group%2Fpcoqs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAC-Group%2Fpcoqs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMAC-Group","download_url":"https://codeload.github.com/SMAC-Group/pcoqs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAC-Group%2Fpcoqs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269832197,"owners_count":24482301,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"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":"2025-08-11T04:36:45.281Z","updated_at":"2025-08-11T04:36:45.975Z","avatar_url":"https://github.com/SMAC-Group.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"pcoqs\"\noutput: github_document\n---\n\n\u003cimg src=\"man/figures/peacocks.png\" align=\"right\" height=\"200\" /\u003e\n\n**Differentially Private Conformal Prediction**  \nAn R package for producing differentially private interval and set-valued predictions for regression and classification.\n\n---\n\n## 🔍 Overview\n\n`pcoqs` provides functionality for conformal prediction enhanced with differential privacy. It supports:\n\n- Regression prediction intervals  \n- Classification prediction sets (multiclass + binary)  \n- Custom nonconformity scores and model/predict wrappers  \n- Gaussian noise injection for private quantile estimation\n\n---\n\n## 🧪 Installation\n\n```r\n# Install from GitHub (requires devtools)\ndevtools::install_github(\"SMAC-Group/pcoqs\")\n```\n\n---\n\n## 🚀 Quick Start\n\n### Regression Example\n\n```r\nlibrary(pcoqs)\n\nset.seed(123)\nX \u003c- matrix(rnorm(100 * 3), ncol = 3)\nY \u003c- X %*% c(1, -2, 1) + rnorm(100)\n\nmodel \u003c- lm(Y ~ ., data = data.frame(Y, X))\n\nresult \u003c- pcoqs(model, X, Y, X, alpha = 0.1, rho = 1.0)\nhead(result$output)\n```\n\n### Classification Example\n\n```r\nlibrary(pcoqs)\nlibrary(nnet)\n\nset.seed(456)\nX \u003c- matrix(rnorm(200 * 3), ncol = 3)\nprobs \u003c- t(apply(X, 1, function(row) {\n  logits \u003c- c(0, row[1], -row[2])\n  exp_logits \u003c- exp(logits)\n  exp_logits / sum(exp_logits)\n}))\nY \u003c- apply(probs, 1, function(p) sample(1:3, 1, prob = p))\n\nmodel \u003c- multinom(as.factor(Y) ~ ., data = data.frame(Y = as.factor(Y), X), trace = FALSE)\n\nresult \u003c- pcoqs(\n  model, X, Y, X,\n  alpha = 0.1, rho = 1.0,\n  predict_fun = function(model, X, ...) predict(model, data.frame(X), type = \"probs\"),\n  score_fun = function(y, probs) sapply(1:length(y), function(i) 1 - probs[i, y[i]]),\n  output_fun = function(probs, q) {\n    data.frame(predicted_set = apply(probs, 1, function(p) paste(which(p \u003e= 1 - q), collapse = \",\")))\n  },\n  lower_bound = 0, upper_bound = 1\n)\nhead(result$output)\n```\n\n---\n\n## 📘 Documentation\n\nSee function documentation using `?pcoqs`, `?priv_quant`, and `?noisy_rc` once installed.\n\n---\n\n## 🛡️ License\n\nMIT © Roberto Molinari\n\n---\n\n## 🦚 Peacocks for Privacy\n\nBecause statistical elegance deserves visual elegance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmac-group%2Fpcoqs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmac-group%2Fpcoqs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmac-group%2Fpcoqs/lists"}