# AiLearning: 16 chapters of Machine Learning in Action, pinned to Python 2.7

> ApacheCN's AiLearning is a Chinese study site for Peter Hassabin's Machine Learning in Action, published as markdown and a website rather than a library. Its value is the notes and the roadmap; its cost is an interpreter the project tells you not to use and datasets it does not ship.

**apachecn/ailearning** — AiLearning：数据分析+机器学习实战+线性代数+PyTorch+NLTK+TF2

- Repository: https://github.com/apachecn/ailearning
- Website: http://ailearning.apachecn.org/
- Stars: 42,566 · Forks: 11,504
- Language: Python
- License: NOASSERTION
- Published: 2026-08-17 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/apachecn-ailearning

## A book in markdown, not a package you install

AiLearning is a book that lives in a GitHub repository. The description names the mixture: data analysis, machine learning in practice, linear algebra, PyTorch, NLTK and TensorFlow 2. The bulk of it is 16 chapters whose source line reads Machine Learning in Action, annotated as personal notes, running from KNN and naive Bayes through logistic regression, SVM, ensembles, regression, tree regression, K-Means, Apriori, FP-growth, PCA, SVD and MapReduce. Every chapter link points at a markdown file under `/docs/ml/`, so there is nothing to install with pip and no module to import, even though GitHub labels the repository's primary language Python.

Start where the README points: read the site at http://ailearning.apachecn.org, whose older edition sits at alv1.apachecn.org, then take the beginner path the roadmap gives as step 1, then 2, then 3. Intermediate material lives in a separate repository, apachecn/ai-roadmap. For video, the project offers two editions on bilibili, a teaching version for the theory and a discussion version that walks the code line by line, and tells you to combine them as you see fit.

## One repository, two Python versions, opposite answers

The version tables contradict each other, and the source material explains why. Under the machine learning section, 3.6.x is marked unsupported and 2.7.x is marked supported, and the note under the table says the book is only for study, tells you to use Python 2.7.x, and adds that 3.6.x has only been partially modified. Two sections later, under deep learning, the same table is inverted: 3.6.x supported, 2.7.x not.

So one clone asks for a Python 2 interpreter for its first sixteen chapters and a Python 3 interpreter for the deep learning pages, and nothing in the README says how to satisfy both. Consequence for a reader whose only interpreter is Python 3: the machine learning half is the half that breaks, and the project admits in advance that its port is partial. You will end up maintaining two environments on one machine, which the README never addresses.

## The datasets are not in this repository

None of the data is here. The README funnels every dataset to a second repository, apachecn/data, with separate paths for the book files, the machine learning material, the deep learning material and the recommender system material, plus a Baidu Cloud bundle offered through that repository's issue 3. A chapter whose code opens a local data file therefore has nothing to open until you clone a different project and put the files where the note expects, and the README never names those filenames because the filenames belong to the book.

That is the largest setup step in this project, and it lives outside the repository you cloned. A reader who assumes a self-contained tutorial stops at the first chapter that reads a file. The only linked reference document the project keeps is a single file called AI常用函数说明.md, and everything else in the notes points outward to videos, other people's notes and other repositories.

## PyTorch and TensorFlow sections are marked as pending

The description advertises PyTorch and TensorFlow 2.0, and both tutorial sections in the README are two lines long: a heading followed by 待更新, a to-do marker. Under the TensorFlow 2.0 heading, however, a directory listing survives underneath, naming an install guide, a Keras quick start, and two practice projects, a movie sentiment classifier and a car fuel efficiency model. So the TensorFlow branch has pages behind its stub, and the PyTorch branch has the stub alone with nothing behind it.

The only deep learning theory the repository carries is four links to other people's blog posts, one each for backpropagation, CNN, RNN and LSTM, hosted on cnblogs and csdn rather than in the project. If PyTorch is why you cloned the repository, what you get is a heading and a to-do marker, and the fallback is whatever those external pages still serve.

## Chapter 16 moved out, and every chapter has a named owner

Chapter 16 shows how this repository changes shape over time. The row for the recommender system is marked 已迁移, migrated, and its owner cell sends you to github.com/apachecn/RecommenderSystems instead of a file in `/docs/ml/16.md`. Anyone following the chapter list in order walks off the edge of the project on the last step, and the online site has to make the same handoff.

The same table names a 负责人 for every row, a GitHub handle paired with a QQ contact, and types each chapter as introduction, classification, regression, clustering, frequent itemsets, tool or project. That structure says the notes are kept chapter by chapter by named people rather than edited as one work, which is also why the last commit date of 2024-11-12 tells you little about any one chapter. The owner column is a directory of people, not a status page.

## The only container serves the book, not the tutorials

The repository ships one container definition and it has nothing to do with machine learning:

```dockerfile
FROM httpd:2.4
COPY ./ /usr/local/apache2/htdocs/
```

That is an Apache httpd image with the whole working directory dropped into its document root, which matches the rest of the tree: a `.nojekyll` file, an `index.html`, a `404.html`, an `img/` directory and an `asset/` directory. The site is served as static files. No interpreter, no numerical stack, nothing that executes a chapter, and the pages are Chinese throughout. Build this image and you get a web server for the notes, then still have to assemble the Python 2.7 environment the machine learning pages ask for by hand.

## Four content trees and an unexplained run_example.py

The tree holds four places where material could live: `docs/`, which the chapter links point into, `src/`, `tutorials/`, and a directory named `old/`. Add `run_example.py` at the root, an `update.sh`, and `NAV.md` with `SUMMARY.md` for navigation, and a new reader's question is which tree the README is describing. The chapter links say `docs/`. Nothing says what `src/` contains, what `tutorials/` adds, or whether anything in `old/` is still current, and the README does not say what `run_example.py` executes or what `update.sh` does to the published site.

Practical effect: an old link or a search result that lands in this repository can drop you into a copy that no longer matches the chapter list, and there is no note in the tree telling you which copy is the live one. If you are following the notes rather than reading them, work from the `/docs/ml/` paths the README gives and ignore everything else.

## CC BY-NC-SA 4.0 on the page, NOASSERTION in the metadata

The README states its own terms as 协议：CC BY-NC-SA 4.0, while the repository metadata reports the license as NOASSERTION, which means no license could be detected. The two statements do not line up, and the difference is not academic. CC BY-NC-SA 4.0 carries a non-commercial clause and a share-alike requirement for adaptations, so an organisation that wants to fold these translations into internal material has to resolve the terms by reading the page rather than by reading machine-readable metadata.

Version tags do not settle the question either. The two releases are v1.0, published on 2017-04-28, and v2.0, published on 2017-10-09, while the last commit to the repository was on 2024-11-12. A tag from 2017 says nothing about the state of the notes, and nothing in the repository marks which chapters were touched after it.

## Conclusion

Read AiLearning if you want the Machine Learning in Action material in Chinese with a stated order to follow it in, and you are willing to set up a Python 2.7 environment and clone apachecn/data yourself. Skip it if you need a maintained library, a PyTorch tutorial, or code you can install and import, because the PyTorch section is a pending marker, there is no package on PyPI, and the last commit was on 2024-11-12. Before you start, check the Python version table against the interpreter you have, and read the terms at the top of the README, because the page states CC BY-NC-SA 4.0 while the repository metadata reports NOASSERTION.

## FAQ

### What is ApacheCN AiLearning and what does it contain?

It is a Chinese study site built around 16 chapters of Machine Learning in Action, annotated as personal notes and published as markdown files under `/docs/ml/` plus a website at http://ailearning.apachecn.org. A deep learning section sits alongside the machine learning one, and the description also names data analysis, linear algebra, PyTorch, NLTK and TensorFlow 2.

### Which Python version does AiLearning support?

The tables disagree. The machine learning section marks 2.7.x as supported and 3.6.x as unsupported, with a note telling you to use Python 2.7.x because 3.6.x was only partially modified, while the deep learning section marks 3.6.x as supported and 2.7.x as not.

### Where do I get the data for the AiLearning examples?

Not from this repository. The README sends every dataset to the separate apachecn/data repository, with paths for the book files, the machine learning material, the deep learning material and the recommender system material, plus a Baidu Cloud bundle offered through that repository's issue 3.

### How do I run the AiLearning examples?

There is no install command, because the project is notes rather than a package. The repository's only container is an Apache httpd image that copies the files into the document root, so it serves the site and cannot execute a chapter, and the README says nothing about setting up a Python environment for the examples.

### Is ApacheCN AiLearning still being worked on?

The repository is not archived and the last commit was on 2024-11-12. The only tagged releases are v1.0 from 2017-04-28 and v2.0 from 2017-10-09, and the PyTorch and TensorFlow tutorial sections are still marked as pending update.

## Sources

- [Official documentation](http://ailearning.apachecn.org/)
- [Official README](https://github.com/apachecn/ailearning#readme)
- [Project repository](https://github.com/apachecn/ailearning)
- [Release notes](https://github.com/apachecn/ailearning/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/apachecn-ailearning
