explaingit

fengdu78/lihang-code

19,581Jupyter NotebookAudience · developerComplexity · 2/5DormantSetup · easy

TLDR

Python implementations of machine learning algorithms from a popular Chinese textbook, with Jupyter Notebooks showing how each algorithm works step-by-step.

Mindmap

mindmap
  root((repo))
    What it does
      Algorithm implementations
      Chapter-by-chapter code
      Jupyter Notebooks
    Algorithms covered
      Supervised learning
      Unsupervised learning
      Probabilistic models
    Use cases
      Study companion
      Interview prep
      Algorithm verification
    Tech stack
      Python
      Jupyter
      NumPy/Pandas
    Audience
      ML students
      Interview candidates
      Chinese tech industry

Things people build with this

USE CASE 1

Study machine learning algorithms alongside the textbook by running working code examples.

USE CASE 2

Prepare for machine learning job interviews by reviewing algorithm implementations and mathematical concepts.

USE CASE 3

Verify your own algorithm implementations by comparing them against reference code.

Tech stack

PythonJupyter NotebookNumPyPandasScikit-learn

Getting it running

Difficulty · easy Time to first run · 5min
License could not be detected automatically. Check the repository's LICENSE file before use.

In plain English

This repository contains Python code implementations of the algorithms described in "Statistical Learning Methods" (统计学习方法), a well-known Chinese machine learning textbook by Li Hang. The book is considered an essential reference for machine learning, covering fundamental supervised and unsupervised learning algorithms with mathematical rigor, and is frequently cited in Chinese university courses and tech industry interview preparation. The code is organized chapter by chapter, with Jupyter Notebooks implementing each algorithm from scratch. Topics covered include the perceptron, k-nearest neighbors, naive Bayes, decision trees, logistic regression, support vector machines (SVM), boosting methods, the EM algorithm, hidden Markov models, conditional random fields, clustering, singular value decomposition, principal component analysis, latent semantic analysis, Markov Chain Monte Carlo, and the PageRank algorithm. The second edition of the book is the one matched by this code. Someone would use this repository as a companion to studying the textbook, running the notebook implementations to see how each algorithm works in practice, verifying their own understanding, or preparing for machine learning job interviews in the Chinese tech industry.

Copy-paste prompts

Prompt 1
Show me how the perceptron algorithm is implemented in Python using this repository's code.
Prompt 2
I'm studying support vector machines, walk me through the SVM implementation in these notebooks.
Prompt 3
How does the EM algorithm work? Show me the code implementation from this repository.
Prompt 4
I need to understand decision trees for an interview, explain the decision tree code in this repo.
Prompt 5
Implement k-nearest neighbors from scratch using the approach shown in these notebooks.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.