# lazyprogrammer/machine_learning_examples: a course companion repo, not a library

> The repository is a folder-per-course collection of Python scripts and notebooks that accompanies the Lazy Programmer courses. It is useful if you are enrolled in one of those courses; it is a poor fit if you want a maintained package with versioned releases.

**lazyprogrammer/machine_learning_examples** — A collection of machine learning examples and tutorials.

- Repository: https://github.com/lazyprogrammer/machine_learning_examples
- Website: https://lazyprogrammer.me
- Stars: 8,924 · Forks: 6,398
- Language: Python
- License: not declared
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/lazyprogrammer-machine-learning-examples

## What machine_learning_examples actually is, and who it is for

This is a companion repository for paid video courses, not a library you import. The README says it plainly: the code for each course is separated by folder, and one folder equals one course. The top level confirms that structure. You can see ab_testing/, ann_class/, ann_class2/, cnn_class/, cnn_class2/, hmm_class/, keras_examples/, kerascv/, nlp_class/ through nlp_class3/, nlp_v2/, numpy_class/, openai/, prophet/, pytorch/, recommenders/, rl/ through rl4/, rnn_class/, stats/, supervised_class/ and supervised_class2/, svm_class/, tensorflow/, tf2.0/, timeseries/, transformers/, and several unsupervised_class folders. Alongside those sit math folders such as calculus/, linear_algebra/, matrix_calculus/, and probability/, plus a single loose file, best_fit_line.py.

The intended reader is a student in one of those courses who needs the exact script shown in a lecture. That is a narrow audience, and the repository is honest about it. The README does not claim to be a curated reference, does not describe a unified API, and does not present the folders as a progression. If you arrived from a search for Python machine learning examples, the material is real and runnable in principle, but you have to pick a folder and read its scripts to understand what it does, because the repository has no documentation layer above the directory names.

## One folder per course: how the code is organised

The organising principle is the course, not the algorithm or the library. That has a visible consequence: related techniques are spread across folders that look interchangeable. There are separate rl/, rl2/, rl2v2/, rl3/, rl3v2/ and rl4/ directories, and separate nlp_class/, nlp_class2/, nlp_class3/ and nlp_v2/ directories. Those numbers track the course versions, not a semantic version of the code. Nothing in the README maps a folder name to a course title; it directs you to watch the "Where to get the code" lecture inside the course, usually Lecture 2 or 3, to make that connection yourself.

Library coverage is similarly split by era. There is a tensorflow/ folder and a separate tf2.0/ folder, a keras_examples/ folder and a kerascv/ folder, and a pytorch/ folder. The README states that beginning with Tensorflow 2 the author started using Google Colab, and that for those courses the code will be on Colab unless otherwise noted, with notebook links provided in the course. So the folder tree is not a complete record of any course. If you are looking for the newest material, the repository may not contain it at all, and the README does not list which folders are incomplete.

## Installing it and running a first example

There is no package to install. According to the README, the way to get the code is to clone the repository, and it explicitly recommends not forking, because forks go out of date as the courses are updated. The README suggests pulling frequently.

```bash
git clone https://github.com/lazyprogrammer/machine_learning_examples.git
cd machine_learning_examples
```

After cloning you land in the top-level directory containing the course folders. There is no setup.py, no pyproject.toml, no requirements file and no documented install target in the README, so dependency installation is left to you. The README gives no command for it, and the repository listing shows no environment file at the top level. Treat each folder as its own small project and read the imports in the script you intend to run.

```bash
ls
ls linear_regression_class
```

The first command lists the course folders and the single top-level script, best_fit_line.py. The second shows the contents of one folder so you can see which scripts it holds before choosing one. From there the workflow is: pick the folder that matches your course, open the script or notebook, and install whatever its imports require. Expect the older folders to target older library versions, since the folders were written across different course generations.

## Why the README tells you not to fork

The fork warning is the most opinionated statement in the README, and it is worth taking literally. The stated reason is that many forks are out of date, and because the courses are updated continuously, a fork becomes stale. The recommended workflow is to clone and then run git pull randomly and frequently.

```bash
git pull
```

That instruction carries an implicit constraint: this repository is meant to be consumed as a moving target. There are no releases, so there is no version to pin to and no changelog to read before you pull. If you build anything on top of a specific script, a later pull can change it underneath you with nothing in the repository announcing the change. For a student following lectures in order, that is fine. For anyone treating a script here as a stable dependency, it is a real hazard, and the README offers no mitigation beyond cloning instead of forking.

## Where the repository stops: Colab, missing code, and no licence file

The clearest limitation is stated by the README itself: not all code from all courses is in the repository. Some newer examples, most of the Tensorflow 2.0 material in particular, were done in Google Colab, and the README points you to the course lectures for those links. So a search of the folder tree is not a reliable way to determine whether a given example exists. You may find a folder for a topic and still not find the specific notebook a lecture refers to.

The second gap is licensing. The repository listing gives no licence file at the top level, and no licence identifier is attached to the project. That matters more here than in a typical code sample collection, because the code is tied to commercial courses. Without a licence file, the terms under which you may reuse the code outside your own study are not stated in the repository. This is not a legal opinion, just an observation about what the repository does and does not publish.

A third gap is documentation. The README explains where to find code and warns against forking. It does not document dependencies, expected outputs, dataset locations, or how to run anything. The data_csv/ and mnist_csv/ folders suggest some scripts expect CSV data to be present, but the README says nothing about obtaining it.

## How it differs from scikit-learn examples and course notebooks

The natural comparison is the scikit-learn example gallery, and the difference is in what each is for. The scikit-learn examples are written against a single, versioned library with a documented API, and each example is expected to run against the installed version of that library. This repository is written against whatever library generation the corresponding course used, which is why tensorflow/ and tf2.0/ coexist and why there are six reinforcement learning folders. You get the code as it was taught, not code normalised to a current API.

A second alternative is a self-contained course notebook, including the Colab notebooks the README points to for newer material. A Colab notebook carries its own environment and can be run without local setup. A script in this repository assumes you have assembled a Python environment yourself. The trade-off is the reverse of what you might expect: the repository is better for reading code offline and diffing it against your own, while Colab is better for running the newest material, since the README says that is where it lives.

## Conclusion

Adopt it if you are working through one of the Lazy Programmer courses and need the matching code, and clone it rather than forking so that git pull keeps you current. Do not adopt it as a dependency or as a general-purpose reference library: there is no packaging, no versioned release, and the README states that some newer examples, most Tensorflow 2.0 material in particular, live in Google Colab instead. Before relying on a folder, check the "Where to get the code" lecture for your course to confirm which folder maps to it, because the README does not publish that mapping itself.

## FAQ

### What are examples of machine learning in the lazyprogrammer/machine_learning_examples repository?

The repository is organised by course rather than by technique, and the top-level folders cover areas such as regression, neural networks, convolutional networks, natural language processing, hidden Markov models, recommender systems, reinforcement learning, and time series, plus math folders for linear algebra, calculus, matrix calculus and probability.

### Is ChatGPT an example of machine learning in the lazyprogrammer/machine_learning_examples repository?

The repository has an openai/ folder and a chatgpt_trading/ folder, and the README links to a course titled Generative AI: ChatGPT & OpenAI LLMs in Python. The repository does not describe ChatGPT itself as an example inside the code collection.

### What is machine learning with an example, according to lazyprogrammer/machine_learning_examples?

The repository does not define machine learning. It supplies runnable Python code per course, so the practical answer is to pick a folder such as linear_regression_class/ or ann_class/ and read the scripts, which the README says correspond to individual courses.

### What are the 7 types of machine learning covered by lazyprogrammer/machine_learning_examples?

The repository does not enumerate seven types of machine learning. Its topics list on the repository covers data-science, deep-learning, machine-learning, natural-language-processing, python and reinforcement-learning, and the folders are grouped by course instead of by a taxonomy.

### What is machine learning examples in the lazyprogrammer/machine_learning_examples repository?

The repository answers that with folders rather than prose: numpy_class/, linear_regression_class/, logistic_regression_class/, supervised_class/ and supervised_class2/, unsupervised_class/ through unsupervised_class3/, cnn_class/ and cnn_class2/, and rnn_class/ among others, each tied to a course.

### What are AI and machine learning examples in the lazyprogrammer/machine_learning_examples repository?

The README links courses covering generative AI with ChatGPT and OpenAI LLMs, deep reinforcement learning, and computer vision, and the folder tree includes openai/, chatgpt_trading/, rl/ through rl4/, and kerascv/ as the matching code locations.

## Sources

- [Issues](https://github.com/lazyprogrammer/machine_learning_examples/issues)
- [lazyprogrammer/machine_learning_examples on GitHub](https://github.com/lazyprogrammer/machine_learning_examples)
- [Project website](https://lazyprogrammer.me)
- [README](https://github.com/lazyprogrammer/machine_learning_examples/blob/master/README.md)

---

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