{"id":17154244,"url":"https://github.com/jaydu1/ood-ridge","last_synced_at":"2025-03-24T13:24:34.341Z","repository":{"id":230643968,"uuid":"779882568","full_name":"jaydu1/ood-ridge","owner":"jaydu1","description":"Optimal Ridge Regularization for Out-of-Distribution Prediction","archived":false,"fork":false,"pushed_at":"2024-03-31T13:15:50.000Z","size":483,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T18:30:47.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/jaydu1.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}},"created_at":"2024-03-31T03:30:14.000Z","updated_at":"2024-09-14T11:00:14.000Z","dependencies_parsed_at":"2024-03-31T04:24:42.438Z","dependency_job_id":"e66f3d80-a944-491b-9c99-621467a7c252","html_url":"https://github.com/jaydu1/ood-ridge","commit_stats":null,"previous_names":["jaydu1/ood-ridge"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydu1%2Food-ridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydu1%2Food-ridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydu1%2Food-ridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydu1%2Food-ridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydu1","download_url":"https://codeload.github.com/jaydu1/ood-ridge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245277139,"owners_count":20589102,"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":[],"created_at":"2024-10-14T21:48:42.658Z","updated_at":"2025-03-24T13:24:34.314Z","avatar_url":"https://github.com/jaydu1.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Optimal Ridge Regularization for Out-of-Distribution Prediction\n\nThis repository contains code for reproducing results in the paper *Optimal Ridge Regularization for Out-of-Distribution Prediction*.\n\n\n## Scripts\n\nThe following files are included in this repository:\n- Util functions:\n    - `generate_data.py`: A Python script that generates the data set.\n    - `compute_risk.py`: A Python script that computes the empirical and theoretical risks of ridge predictor and ensembles.\n    - `fixed_point_sol.py`: A Python script that computes the fixed-point solutions in $(\\lambda,\\phi)$.\n- Ex1\n    - `ex1_equiv_lam_min.py`: compute the minimum feasible $\\lambda$.\n    - `ex1_opt_ridge.py`: compute the in-distribution risk of ridge predictors.\n    - `ex1_opt_ridge_ood.py`: compute the OOD risk of ridge predictors.\n- Ex2\n    - `ex2_MNIST.py`: compute the OOD risk with distribution shifts on MNIST datasets.\n- Ex3\n    - `ex3_mono.py`: compute the ridge risk at different values of $\\lambda$.\n    - `ex3_MNIST.py`: compute the OOD risk at different values of $\\lambda$ on MNIST datasets.\n- Ex4\n    - `ex4_equiv_v.py`: compute the fixed-point solutions in $(\\lambda,\\phi)$.\n    - `ex4_equiv_risk.py`: compute the risks of ridge predictors in $(\\lambda,\\phi)$.\n- Ex5: Figure F8\n    - `ex5_theory_ridge_opt.py`: theoretical risk of ridge predictors.\n    - `ex5_theory_ridgeless.py`: theoretical risk of full-ensemble ridgeless predictors.\n- Visualization:\n    - `Plot.ipynb`: A Jupyter notebook that visualizes the results.\n\n\n## Computation details\n\nAll the experiments are run on Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-72-generic x86_64) using 12 cores.\n\nThe estimated time to run all experiments is roughly less than 2 hours for each script.    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydu1%2Food-ridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydu1%2Food-ridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydu1%2Food-ridge/lists"}