Learn Machine Learning with Python
A free, hands-on machine learning course. Write real scikit-learn code, train models on real datasets and watch your charts appear in the Plots tab, one small step at a time.
233 lessons231 challenges965 quiz questions
- Beginner friendly
AI-assisted coding help
Hands-on interactive lessons
Audio narration on every lesson
Quizzes to test your knowledge
Free certificate of completion
Train a model in your browser
Real scikit-learn code with its real output. Drag the slider to change one line and see what the model learns.
Small k memorizes every training point and draws a jagged border. Larger k smooths it out.
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_moons
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
X, y = make_moons(n_samples=200, noise=0.3, random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
k = 5
model = KNeighborsClassifier(n_neighbors=k)
model.fit(X_train, y_train)
print(f"train accuracy: {model.score(X_train, y_train):.2f}")
print(f"test accuracy: {model.score(X_test, y_test):.2f}")
xx, yy = np.meshgrid(np.linspace(-2, 3, 56), np.linspace(-1.5, 2, 40))
proba = model.predict_proba(np.c_[xx.ravel(), yy.ravel()])[:, 1]
proba = proba.reshape(xx.shape)
plt.figure(figsize=(5, 4))
plt.pcolormesh(xx, yy, proba, cmap="coolwarm", alpha=0.35)
plt.scatter(X_train[:, 0], X_train[:, 1], c=y_train,
cmap="coolwarm", edgecolors="k")
plt.title(f"k-nearest neighbors, k = {k}")
plt.show()
Syllabus
Section 1
Data and PlotsDedicated page
Start sectionStartThe toolkit every machine learning project starts with: NumPy arrays, matplotlib charts and pandas tables. Load real datasets, summarize them and plot what you find.Introduction
4 lessons320NumPy Arrays
5 lessons520Array Math
6 lessons625Shaping Data
4 lessons415Line and Scatter Plots
6 lessons625Charts for Data
5 lessons520pandas DataFrames
6 lessons625Filtering and Sorting
5 lessons520Grouping and Cleaning
5 lessons520Plotting DataFrames
5 lessons520Datasets for ML
5 lessons520Final Challenges
4 lessons420Section 2
Statistics for MLDedicated page
Start sectionStartThe statistics behind every model: center and spread, distributions, probability by simulation, samples, outliers, correlation, trend lines and group tests, then scaling and encoding features. Every idea is computed on real data and plotted.Center and Spread
6 lessons625Distributions
6 lessons625Probability by Simulation
6 lessons625Samples and Populations
5 lessons520Outliers
5 lessons520Relationships
6 lessons525Trend Lines
6 lessons625Comparing Groups
6 lessons625Feature Scaling
5 lessons520Encoding Categories
4 lessons415Exploring a Dataset
5 lessons520Final Challenges
4 lessons420Section 3
Supervised LearningDedicated page
Start sectionStartTrain real models with scikit-learn: split, fit, predict and measure. k-NN, linear and logistic regression, trees, forests and boosting, honest evaluation with cross-validation, and pipelines, ending with an end-to-end penguin project.Your First Model
5 lessons520Nearest Neighbors
5 lessons520Linear Regression
5 lessons520Logistic Regression
5 lessons520Measuring Classifiers
6 lessons625Decision Trees
5 lessons520Overfitting
5 lessons520Cross-Validation
4 lessons415Ensembles
4 lessons415Pipelines
5 lessons520Project: Penguin Species
5 lessons525Final Challenges
4 lessons420Section 4
Unsupervised LearningDedicated page
Start sectionStartFind structure in data without labels: k-means, hierarchical and density clustering, PCA to see and compress many features, and anomaly detection, ending with a digits exploration project.Finding Groups
5 lessons520Choosing k
5 lessons520Reading Clusters
5 lessons520Hierarchical Clustering
4 lessons415Density Clustering
4 lessons415Fewer Dimensions
5 lessons520PCA in Practice
5 lessons520Anomaly Detection
5 lessons520Clusters at Work
4 lessons415Project: Digit Explorer
5 lessons525Final Challenges
4 lessons420
Learn by Doing
Write real code, query databases, build websites, and master AI prompts. Our interactive lessons cover every skill modern developers need.
Build Your Streak
Stay consistent and watch your progress grow! Track your daily coding habit, protect your streak with freeze days, and earn rewards for showing up every day.
12 days streak
Return tomorrow to keep your streak!
January 2026
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
21
22
23
24
25
26
27
28
29
30
Double or Nothing
Day 5 of 7
Streak Freeze
2 left
You're Not Alone
Compete on global leaderboards, invite friends to earn rewards, and celebrate each other's wins. Coding is better with friends!
Every way to learn
Read, listen, test yourself, ask the AI, or look up anything you've already covered. Every lesson meets you where you are.
A variable is a named container that stores a value you can reference later in your program.
In Python, you create one by writing the name, an equals sign, then the value you want to store.
The value can change over time. Reassigning the name simply points it to a new value.
Earn a Certificate
Earn certificates for every course you complete. Add them to your LinkedIn profile and resume to showcase your coding expertise to employers.
Why learn machine learning with Coddy
- You see it before you read it. Every lesson opens with a chart or a diagram: a scatter of iris flowers, a decision boundary, a dendrogram. Then you write the code and your own chart appears in the Plots tab beside it.
- Real Python, real libraries.
numpy,pandas,matplotlib,scipyandscikit-learnrun on Coddy, the same versions data scientists use, somodel.fit(X_train, y_train)here ismodel.fit(X_train, y_train)at work. Nothing to install, no notebook to set up. - Four sections in the order the work happens: data and plots, statistics for ML, supervised learning, then unsupervised learning. 233 short lessons, each with one new idea and a task that uses it.
- Real datasets with a story: iris flowers, wine chemistry, handwritten digits, Palmer penguins. You finish two projects, a penguin species classifier and a digit explorer, and every chart is titled and labelled so it could go in a report.
Frequently asked questions about learning machine learning
What is machine learning?
Machine learning is teaching a computer by example instead of by rules. You show a model many rows of data, say flowers with their petal sizes and species, and it learns a pattern it can use on rows it has never seen. If the rows come with answers, that is supervised learning; if they do not and the model finds groups on its own, that is unsupervised learning. This course teaches both.
Do I need to be good at math to learn machine learning?
No. You need school arithmetic and the patience to read a chart. The course teaches the statistics machine learning uses (averages, spread, distributions, correlation, p-values) with simulations and pictures, and scikit-learn does the heavy math for you. Calculus and linear algebra help if you later want to build new algorithms, but you do not need them to train, test and understand models.
Do I need to know Python first?
if, loops, functions and lists. That is the Fundamentals section of the Python course, a few weeks at an hour a day. Everything after that, import, NumPy, pandas, matplotlib and scikit-learn, is taught here from the first line.Which Python libraries will I learn?
The standard machine learning stack: NumPy for arrays, pandas for tables, matplotlib for charts, SciPy for statistics and scikit-learn for the models (k-nearest neighbors, linear and logistic regression, decision trees, random forests, gradient boosting, k-means, DBSCAN, PCA and more). They run on Coddy at current versions, so what you write here runs the same on your own computer.
Do I need a GPU or a powerful computer?
No. Your code runs on Coddy's servers and the charts come back to your browser, so a laptop, a Chromebook or a tablet is enough. Classic machine learning with scikit-learn runs fine on an ordinary processor anyway; a GPU matters for training large neural networks, which this course does not cover.
What can I build after this course?
Models that answer real questions from a table: is this email spam, which customers are likely to leave, which species is this penguin, how many bikes will be rented tomorrow, which groups of shoppers exist, which server readings look wrong. You also learn to judge them honestly with test sets, cross-validation, confusion matrices and ROC curves, which is what makes a model worth trusting.
How long does it take to learn machine learning?
Is this machine learning course free?
Yes. The lessons, the charts, the AI hints and the certificates are free. A free account works through a few lessons a day, and Pro removes the daily limit.