# SleepyBag/Statistical-Learning-Methods

Implement Statistical Learning Methods, Li Hang the hard way. 李航《统计学习方法》一书的硬核 Python 实现

Repository: https://github.com/SleepyBag/Statistical-Learning-Methods
Canonical: https://ross.abutalabs.com/products/statistical-learning-methods
Language: Python
License Family: other
Last push: 2022-06-04T03:35:56+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2210, "days_push": 1551, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1175, forks 276 (observed 2026-08-28T04:03:52.393784+00:00)

## What it is
A Python implementation of every algorithm from Li Hang's textbook 'Statistical Learning Methods', built from scratch with NumPy matrix operations. It covers models like perceptron, kNN with kd-tree, naive Bayes, decision trees, logistic regression, max entropy, HMM with Baum-Welch, and linear chain CRFs, each with runnable examples.

## Use cases
- study algorithms from the Statistical Learning Methods book with working code
- see a from-scratch implementation of the max entropy model
- learn how a linear chain conditional random field is implemented
- understand HMM training with the Baum-Welch algorithm
- compare ID3, C4.5, and CART decision tree implementations
- find vectorized NumPy versions of classic ML algorithms

## When to choose
- you are reading Li Hang's book and want code for every chapter
- you want educational, detail-complete implementations rather than production libraries
- you need rare implementations like max entropy or linear chain CRF from scratch

## When to avoid
- you need a production-ready, well-tested ML library
- you require a maintained package with a license and installable releases
- you want GPU-accelerated or deep learning frameworks

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: machine-learning, data-science
- domain: machine-learning, education, tutorials
- platform: python, cross-platform
- tags: statistical-learning, li-hang, textbook-implementations, educational, numpy, algorithms-from-scratch

## Member repositories
- SleepyBag/Statistical-Learning-Methods (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:52.393784+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:27:02.860630+00:00, confidence not recorded.
  - readme: https://github.com/SleepyBag/Statistical-Learning-Methods (fetched 2026-08-28T04:03:52.393784+00:00, sha aada3cd5839b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
