Install
Set up R and Python to follow along live
If you would like to run the demos on your laptop, install one or both of the combss packages below. The same demos exist in R and Python with matching results, so either language is fine.
R
install.packages("combss")That’s it — combss is on CRAN. The only run-time dependency is glmnet, which CRAN will install automatically. Tested with R 4.3 and 4.4 on macOS, Linux, and Windows.
Quick check
library(combss)
set.seed(2026)
x <- matrix(rnorm(100 * 20), 100, 20)
y <- as.numeric(x %*% c(2, -1, 1, rep(0, 17)) + rnorm(100) * 0.3)
fit <- combss(x, y, family = "gaussian", q = 5)
fit$subset_list[1:5]Expected output: nested supports building up to {1, 2, 3} at \(k = 3\).
Python
pip install combssPython 3.9 or newer. Dependencies (numpy, scipy, scikit-learn, pandas) install automatically.
Quick check
import numpy as np
from combss import linear
rng = np.random.default_rng(1)
X = rng.standard_normal((100, 20))
beta = np.r_[2, -1, 1, np.zeros(17)]
y = X @ beta + 0.3 * rng.standard_normal(100)
m = linear.model()
m.fit(X, y, q=5, verbose=False)
print(m.subset_list[:3])Expected output: nested supports building up to [0, 1, 2] at \(k = 3\) (Python is 0-indexed).
Editor recommendations
Either of these makes running the demos chunk-by-chunk smooth:
- RStudio — open the
.qmdfile, click the green ▶ on each chunk. - VS Code with the Quarto and Jupyter extensions — same idea, language-aware.
Cloning the demo repository
git clone https://github.com/saratmoka/combss-statfest.git
cd combss-statfestThe Khan SRBCT train/test CSVs live under data/; simulations use inline set.seed() / np.random.default_rng() calls. The rice GWAS demo is precomputed (the raw SNP matrix is too large to ship), and the figures are in figures/rice/. No external downloads at run time.
Print-friendly handouts (conda from scratch)
If you’d rather start completely fresh — clean conda environment, paste-and-run code, no Quarto — these two PDFs walk you through the same demos as the site, end-to-end:
handout-r.pdf— R quick-start (conda env, R inside the env, RStudio Desktop, Demos 1–4)handout-python.pdf— Python quick-start (same env, Spyder, Demos 1–4)
Trouble?
- R cannot find the package: make sure you are on R ≥ 4.0 and check
available.packages()listscombss. If not, your CRAN mirror may be stale; pick another withchooseCRANmirror(). - Python
pip installfails oncombss: confirm you are on Python ≥ 3.9 withpython --version; older versions are unsupported. - Anything else: open an issue at https://github.com/saratmoka/combss-statfest/issues.