Tutorials¶
A guided tour of skein in three tiers. Each tutorial is a focused walkthrough — read in order, or skip to the tier that matches what you already know.
Basics¶
Start here if you’ve never used skein. Three short tutorials that together get you to “fitting and interpreting a sparse model.”
Your first fit —
MCPRegressoron a noisy regression. The mental model:fit/coef_/predict/score.Picking λ — paths, K-fold CV, and information criteria. Three principled options for the regularization-strength choice.
Logistic and Cox — same workflow, different datafit. Demonstrates the
(datafit, penalty)orthogonality that drives the rest of the library.
Working with structure¶
Real data has structure: features cluster into groups, design matrices are sparse, columns have different scales, counts come with exposure. Three tutorials covering the most common practical extensions.
Group penalties — when whole groups of features should be selected together (genes, dummies, bands).
GroupLasso,GroupMCP,SparseGroupMCP— when to use which.Sparse and standardize — scipy.sparse CSC input, per-column standardization, and the dense ↔ sparse equivalence. Plus per-feature weights for soft constraints.
Counts and rates — Poisson regression with log-exposure offsets. Rate ratios, predicting expected counts, and the ubiquitous epidemiology / click-through / insurance pattern.
Advanced¶
The features that differentiate skein from glmnet / skglm / grpreg. Each tutorial covers a method that closes a parity gap with R or adds something none of the alternatives have.
Stability selection — bootstrap-based feature selection without picking a single λ. The M5.x headline differentiator (no clean equivalent in glmnet, skglm, or grpreg).
Adaptive estimators — the oracle property via two-stage refitting. The headline use of skein’s per-feature-weights axis. 30 adaptive classes covering scalar, group, and GLM datafits.
Multinomial and multi-task — K-class softmax classification and multi-response regression. Both reduce to the same row-grouped problem on a virtual block- replicated design.
Graphical models¶
A separate use of the same machinery: estimate sparse precision matrices instead of regression coefficients. Two tutorials covering single- and multi-population network estimation, the workhorse of network psychometrics and Gaussian graphical models.
Graphical lasso end-to-end — fit a sparse precision matrix, tune by EBIC, visualise the recovered graph. L1, MCP, and SCAD variants.
Joint networks — joint estimation across
Krelated populations with an across-population group penalty (Danaher–Wang–Witten 2014).
What’s next after the tutorials¶
Worked examples — full analyses on realistic synthetic data (genomics SNP-style, NLP text classification, survival).
Concepts — the conceptual model behind the abstractions. The four orthogonal axes (penalty, datafit, weights, backend) and how they compose.
Extending — building your own penalty, datafit, or design backend. Both Python ABCs and Rust trait surfaces.
API reference — the complete surface, organized by family.