CodeBlanks Logo Icon CodeBlanks
Free 4 levels

Machine Learning

From ML fundamentals to deep learning. Regression, classification, neural networks, CNN, RNN and transformer models.

All topics from ML fundamentals to deep learning. Regression, classification, neural networks, CNN, RNN and transformer models with practical applications.

  • 346 lessons
  • 31 h 39 min
  • 9 projects

No account needed, you can start right away. To save your progress, create a free account

Levels

The Machine Learning course goes from zero to expert in four levels. Start at any level you like.
Not sure of your level? Take the placement test
Beginner

ML fundamentals, data processing with Python, statistics and first algorithms.

  • What is ML?
  • NumPy basics
  • Pandas basics
  • Data preprocessing
112 lessons · 10 h 12 min See lessons →
Intermediate

Deep dive into scikit-learn, ensemble methods, SVM, clustering and dimensionality reduction.

  • scikit-learn basics
  • Pipeline
  • Cross-validation
  • Grid search
112 lessons · 10 h 12 min See lessons →
Advanced

Neural networks, PyTorch, CNN, RNN, LSTM and transfer learning.

  • Neural network basics
  • PyTorch basics
  • Tensor operations
  • Autograd
78 lessons · 7 h 9 min See lessons →
Expert

Transformers, attention, BERT, GPT, generative models and MLOps.

  • Attention
  • Transformer
  • BERT
  • GPT
44 lessons · 4 h 6 min See lessons →

Projects you will build

At every level you combine what you learned into a real page.

How does it work?

Short explanation

Each lesson explains one concept in a few short cards; no long videos or walls of text.

Try it right away

Multiple choice, fill-in-the-blank and matching exercises lock in what you just learned.

Write it yourself

You write real code in the in-browser editor; it is checked instantly and you see the result live.

Curriculum

62 groups · 346 lessons · 31 h 39 min

ML fundamentals, data processing with Python, statistics and first algorithms.

1
What is ML?
6 lessons · 31 min
  1. 1 What is machine learning? Machine learning is a branch of AI that enables computers to learn from data instead of explicit methods. 5 min
  2. 2 Supervised and unsupervised Supervised learning trains models with labeled data; each example comes with a correct output (label). 5 min
  3. 3 Data and model Data is the learning source for ML algorithms; it consists of feature and label columns. 5 min
  4. 4 Training and testing The model is trained on training data and its performance is measured on test data. 5 min
  5. 5 Feature and label notation In ML, features are typically represented as matrix X and labels as vector y. 5 min
  6. 6 Summary - ML fundamentals In this group you learned the definition, types, and core concepts of ML. 6 min
2
NumPy basics
6 lessons · 31 min
  1. 1 What is NumPy? NumPy is the fundamental library for numerical computing in Python, providing multi-dimensional arrays (ndarray). 5 min
  2. 2 Creating arrays NumPy arrays are created from Python lists using the np.array() function. 5 min
  3. 3 Array properties NumPy arrays have properties like shape, size, ndim, and dtype. 5 min
  4. 4 Array indexing In NumPy arrays, elements are accessed by index; the first element is at index 0. 5 min
  5. 5 Reshaping arrays The reshape() method changes the array's shape while keeping the total element count. 5 min
  6. 6 Summary - NumPy basics In this group you learned to create NumPy arrays, use their properties, and index them. 6 min
3
Pandas basics
6 lessons · 31 min
  1. 1 What is Pandas? Pandas is a Python library for data analysis, providing DataFrame and Series data structures. 5 min
  2. 2 Creating a DataFrame A DataFrame is created with pd.DataFrame() from a dictionary or list. 5 min
  3. 3 Column operations DataFrame columns are accessed with brackets and statistics are computed on them. 5 min
  4. 4 Selecting and filtering data Boolean filtering is used to select rows by condition in a DataFrame. 5 min
  5. 5 Viewing first rows The head() method returns the first n rows of a DataFrame; default n=5. 5 min
  6. 6 Summary - Pandas basics In this group you learned to create DataFrames, work with columns, and select data. 6 min
4
Data preprocessing
6 lessons · 31 min
  1. 1 Data cleaning Missing data (NaN) is detected and filled or removed. 5 min
  2. 2 Missing data Missing data is detected with df.isna() and filled with df.fillna(). 5 min
  3. 3 Data types Data types (dtype) are categorized as numeric, categorical, and text. 5 min
  4. 4 Label encoding Categorical data is converted to numeric values with LabelEncoder. 5 min
  5. 5 Data splitting Data is split into train and test sets with train_test_split. 5 min
  6. 6 Summary - Data preprocessing In this group you learned data cleaning, missing data, and label encoding. 6 min
5
Statistics basics
6 lessons · 31 min
  1. 1 Mean The mean is found by dividing the sum of data by the number of elements. 5 min
  2. 2 Median The median is the middle value when data is sorted. 5 min
  3. 3 Standard deviation Standard deviation shows how much data deviates from the mean. 5 min
  4. 4 Variance Variance is the square of standard deviation and measures data spread. 5 min
  5. 5 Correlation Correlation shows the strength of the relationship between two variables. 5 min
  6. 6 Summary - Statistics In this group you learned mean, median, standard deviation, and correlation. 6 min
6
Linear algebra
6 lessons · 31 min
  1. 1 Vectors A vector is a 1-D array of numbers with magnitude and direction. 5 min
  2. 2 Matrices A matrix is a 2-D array of numbers with rows and columns. 5 min
  3. 3 Matrix multiplication Matrix multiplication is done with np.dot() or the @ operator. 5 min
  4. 4 Transpose In a matrix transpose, rows and columns are swapped. 5 min
  5. 5 Identity matrix An identity matrix is a square matrix with 1s on the diagonal and 0s elsewhere. 5 min
  6. 6 Summary - Linear algebra In this group you learned vectors, matrices, multiplication, and transpose. 6 min
7
Project: Data analysisProject
4 lessons · 28 min
  1. 1 Loading data Load and inspect a dataset with pandas. 7 min
  2. 2 Cleaning data Detect and clean missing data. 7 min
  3. 3 Computing statistics Compute a statistical summary of the data. 7 min
  4. 4 Printing results Print the analysis results. 7 min
8
Regression
6 lessons · 31 min
  1. 1 What is regression? Regression is a supervised learning task that predicts a continuous output value. 5 min
  2. 2 Linear regression Linear regression finds the linear relationship in data and fits a line. 5 min
  3. 3 Model training The model learns from training data with the fit() method and updates weights. 5 min
  4. 4 Prediction A trained model makes predictions on new data with predict(). 5 min
  5. 5 Error measurement Regression error is measured with metrics like MSE and MAE. 5 min
  6. 6 Summary - Regression In this group you learned linear regression, model training, and prediction. 6 min
9
KNN
6 lessons · 31 min
  1. 1 What is KNN? KNN (K-Nearest Neighbors) classifies an example by the majority of its k nearest neighbors. 5 min
  2. 2 The K parameter K sets the number of neighbors; small K overfits, large K underfits. 5 min
  3. 3 Distance measurement KNN measures distance between examples using Euclidean or Manhattan distance. 5 min
  4. 4 Classification KNN classifies a new example by majority vote of its k nearest neighbors. 5 min
  5. 5 Model training KNN is a lazy algorithm; it stores training data as-is. 5 min
  6. 6 Summary - KNN In this group you learned the KNN algorithm, the K parameter, and classification. 6 min
10
Decision trees
6 lessons · 31 min
  1. 1 What is a decision tree? A decision tree is a tree-like model that classifies data by splitting it with questions. 5 min
  2. 2 Splitting criterion Decision trees split data using the gini or entropy criterion. 5 min
  3. 3 Depth The tree depth (max_depth) prevents overfitting. 5 min
  4. 4 Classification A decision tree assigns the majority class at leaf nodes. 5 min
  5. 5 Overfitting Very deep trees memorize data; pruning prevents this. 5 min
  6. 6 Summary - Decision trees In this group you learned decision trees, splitting criteria, and overfitting. 6 min
11
Classification
6 lessons · 31 min
  1. 1 What is classification? Classification is the task of assigning data to one of predefined classes. 5 min
  2. 2 Binary classification Binary classification has two classes: positive and negative. 5 min
  3. 3 Multi-class Multi-class classification has more than two classes. 5 min
  4. 4 Accuracy Accuracy is the ratio of correct predictions to total predictions. 5 min
  5. 5 Confusion matrix A confusion matrix shows classification results in detail. 5 min
  6. 6 Summary - Classification In this group you learned classification, accuracy, and confusion matrix. 6 min
12
Model evaluation
6 lessons · 31 min
  1. 1 Train-test split Data is split into train and test sets with train_test_split. 5 min
  2. 2 Accuracy Accuracy is the most common classification metric. 5 min
  3. 3 Precision Precision is the accuracy ratio of positive predictions. 5 min
  4. 4 Recall Recall is the ratio of captured true positives. 5 min
  5. 5 F1 score F1 score is the harmonic mean of precision and recall. 5 min
  6. 6 Summary - Model evaluation In this group you learned train-test split, accuracy, precision, and F1. 6 min
13
Project: ClassificationProject
4 lessons · 28 min
  1. 1 Preparing data Prepare data for classification. 7 min
  2. 2 Training model Train a KNN model. 7 min
  3. 3 Prediction Make predictions with the model. 7 min
  4. 4 Evaluation Calculate model accuracy. 7 min
14
Scaling
6 lessons · 31 min
  1. 1 What is scaling? Scaling brings feature values to a specific range. 5 min
  2. 2 StandardScaler StandardScaler makes data mean 0 and standard deviation 1. 5 min
  3. 3 MinMaxScaler MinMaxScaler compresses data between 0 and 1. 5 min
  4. 4 When to use? Scaling is important for distance-based algorithms like KNN and SVM. 5 min
  5. 5 Pipeline Scaling and model are combined with Pipeline. 5 min
  6. 6 Summary - Scaling In this group you learned StandardScaler, MinMaxScaler, and Pipeline. 6 min
15
Feature engineering
6 lessons · 31 min
  1. 1 What is a feature? A feature is a measurable data column used as model input. 5 min
  2. 2 Feature selection Feature selection simplifies the model by choosing the most informative features. 5 min
  3. 3 Feature extraction Feature extraction derives new features from existing ones. 5 min
  4. 4 Categorical features Categorical features are converted to binary vectors with OneHotEncoder. 5 min
  5. 5 Numerical features Numerical features are scaled to improve model performance. 5 min
  6. 6 Summary - Feature engineering In this group you learned feature selection, extraction, and transformation. 6 min
16
Model selection
6 lessons · 31 min
  1. 1 What is model selection? Model selection is the process of finding the best-performing model and parameters. 5 min
  2. 2 Cross-validation Cross-validation evaluates the model by splitting data into multiple folds. 5 min
  3. 3 Grid search GridSearchCV finds the best parameters by trying all combinations. 5 min
  4. 4 Score comparison Models are compared using validation scores. 5 min
  5. 5 Hyperparameter A hyperparameter is a parameter set before model training. 5 min
  6. 6 Summary - Model selection In this group you learned cross-validation, grid search, and hyperparameter tuning. 6 min
17
Project: RegressionProject
4 lessons · 28 min
  1. 1 Preparing data Prepare data for regression. 7 min
  2. 2 Training model Train a linear regression model. 7 min
  3. 3 Prediction Make predictions with the model. 7 min
  4. 4 Error measurement Measure error with MSE. 7 min
18
Metrics
6 lessons · 31 min
  1. 1 What is a metric? A metric is a numerical value that measures model performance. 5 min
  2. 2 Accuracy Accuracy shows the ratio of correct predictions. 5 min
  3. 3 Precision Precision shows how many positive predictions are correct. 5 min
  4. 4 Recall Recall shows how many true positives are found. 5 min
  5. 5 F1 score F1 is the harmonic mean of precision and recall. 5 min
  6. 6 Summary - Metrics In this group you learned accuracy, precision, recall, and F1 metrics. 6 min
19
Data visualization
6 lessons · 31 min
  1. 1 What is visualization? Data visualization aims to make data understandable with charts. 5 min
  2. 2 Scatter plot A scatter plot shows the relationship between two variables with points. 5 min
  3. 3 Histogram A histogram shows data distribution with bars. 5 min
  4. 4 Line plot A line plot shows change over time. 5 min
  5. 5 Box plot A box plot shows data spread and outliers. 5 min
  6. 6 Summary - Visualization In this group you learned scatter, histogram, and line plots. 6 min
20
Beginner finalFinal
4 lessons · 32 min
  1. 1 Challenge 1 Combine ML fundamentals to analyze data. 8 min
  2. 2 Challenge 2 Process data with NumPy and Pandas. 8 min
  3. 3 Challenge 3 Train a regression model and make predictions. 8 min
  4. 4 Challenge 4 Evaluate a classification model. 8 min

Deep dive into scikit-learn, ensemble methods, SVM, clustering and dimensionality reduction.

1
scikit-learn basics
6 lessons · 31 min
  1. 1 What is scikit-learn? scikit-learn is the core library for classic ML algorithms in Python. 5 min
  2. 2 Estimator API All scikit-learn models share fit() and predict() methods. 5 min
  3. 3 The fit method The fit() method learns the model from training data. 5 min
  4. 4 The predict method The predict() method makes predictions for new data. 5 min
  5. 5 The score method The score() method returns the model's R² or accuracy value. 5 min
  6. 6 Summary - scikit-learn In this group you learned the scikit-learn estimator API. 6 min
2
Pipeline
6 lessons · 31 min
  1. 1 What is a Pipeline? Pipeline combines preprocessing and model steps in a single flow. 5 min
  2. 2 Steps Pipeline steps (scaler, model) run in order. 5 min
  3. 3 fit and predict In a Pipeline, fit() trains all steps, predict() applies all steps. 5 min
  4. 4 Advantages Pipeline prevents data leakage and keeps code clean. 5 min
  5. 5 ColumnTransformer ColumnTransformer applies different transforms to different columns. 5 min
  6. 6 Summary - Pipeline In this group you learned the Pipeline structure and advantages. 6 min
3
Cross-validation
6 lessons · 31 min
  1. 1 What is cross-validation? Cross-validation splits data into k folds and evaluates the model k times. 5 min
  2. 2 K-fold K-fold splits data into k equal parts and tests each part once. 5 min
  3. 3 cross_val_score The cross_val_score function returns k-fold cross-validation scores. 5 min
  4. 4 Stratified Stratified k-fold preserves class distribution in each fold. 5 min
  5. 5 Advantages Cross-validation gives more reliable results than a single train-test split. 5 min
  6. 6 Summary - Cross-validation In this group you learned k-fold cross-validation and cross_val_score. 6 min
4
Grid search
6 lessons · 31 min
  1. 1 What is grid search? Grid search tries all hyperparameter combinations to find the best. 5 min
  2. 2 GridSearchCV GridSearchCV combines grid search and cross-validation. 5 min
  3. 3 param_grid param_grid is a dictionary of hyperparameter values to try. 5 min
  4. 4 best_params_ The best_params_ property gives the best hyperparameter combination. 5 min
  5. 5 best_score_ The best_score_ property gives the best cross-validation score. 5 min
  6. 6 Summary - Grid search In this group you learned GridSearchCV and hyperparameter tuning. 6 min
5
SVM
6 lessons · 31 min
  1. 1 What is SVM? SVM finds the hyperplane that separates classes with the widest margin. 5 min
  2. 2 Margin The margin is the distance from the hyperplane to the nearest points of each class. 5 min
  3. 3 Kernel Kernel increases linear separability by mapping data to higher dimensions. 5 min
  4. 4 C parameter C controls the trade-off between margin width and classification error. 5 min
  5. 5 Classification SVM is used for binary and multi-class classification. 5 min
  6. 6 Summary - SVM In this group you learned SVM, margin, kernel, and C parameter. 6 min
6
Project: SVMProject
4 lessons · 28 min
  1. 1 Preparing data Prepare and scale data for SVM. 7 min
  2. 2 Training model Train an SVM model. 7 min
  3. 3 Prediction Make predictions with SVM. 7 min
  4. 4 Evaluation Calculate SVM accuracy. 7 min
7
Random forest
6 lessons · 31 min
  1. 1 What is random forest? Random forest is an ensemble algorithm that combines multiple decision trees. 5 min
  2. 2 Ensemble Ensemble methods combine predictions from multiple models. 5 min
  3. 3 n_estimators n_estimators sets the number of trees in the forest. 5 min
  4. 4 Bagging Bagging trains each tree with random samples for diversity. 5 min
  5. 5 Feature importance Random forest computes feature importance. 5 min
  6. 6 Summary - Random forest In this group you learned random forest, ensemble, and bagging. 6 min
8
Boosting
6 lessons · 31 min
  1. 1 What is boosting? Boosting trains weak models sequentially to build a strong model. 5 min
  2. 2 AdaBoost AdaBoost increases the weight of misclassified samples for the next model. 5 min
  3. 3 Gradient boosting Gradient boosting improves the model by reducing errors with gradients. 5 min
  4. 4 Learning rate Learning rate scales each tree's contribution. 5 min
  5. 5 Advantages Boosting provides high accuracy but is prone to overfitting. 5 min
  6. 6 Summary - Boosting In this group you learned AdaBoost and gradient boosting. 6 min
9
Clustering
6 lessons · 31 min
  1. 1 What is clustering? Clustering is an unsupervised method that groups unlabeled data by similarity. 5 min
  2. 2 KMeans KMeans is a popular clustering algorithm that divides data into k clusters. 5 min
  3. 3 Centroid A centroid is the center point of a cluster. 5 min
  4. 4 Elbow method The elbow method is used to find the optimal k value. 5 min
  5. 5 Labels KMeans assigns a cluster label to each example, stored in labels_. 5 min
  6. 6 Summary - Clustering In this group you learned clustering, KMeans, and the elbow method. 6 min
10
KMeans in depth
6 lessons · 31 min
  1. 1 KMeans algorithm KMeans initializes k centroids randomly and updates them iteratively. 5 min
  2. 2 Initialization KMeans uses k-means++ as the default initialization method. 5 min
  3. 3 n_init n_init sets the number of different initializations for KMeans. 5 min
  4. 4 inertia_ inertia_ gives the total within-cluster sum of squares. 5 min
  5. 5 random_state random_state makes KMeans results reproducible. 5 min
  6. 6 Summary - KMeans In this group you learned KMeans parameters and properties. 6 min
11
Hierarchical clustering
6 lessons · 31 min
  1. 1 What is hierarchical clustering? Hierarchical clustering groups data in a tree-like structure. 5 min
  2. 2 Dendrogram A dendrogram visualizes hierarchical clustering results as a tree. 5 min
  3. 3 Agglomerative Agglomerative starts each example as a cluster and merges them. 5 min
  4. 4 Linkage Linkage is the method for calculating inter-cluster distance. 5 min
  5. 5 Advantages Hierarchical clustering shows cluster structure without specifying k in advance. 5 min
  6. 6 Summary - Hierarchical clustering In this group you learned hierarchical clustering and dendrograms. 6 min
12
Project: ClusteringProject
4 lessons · 28 min
  1. 1 Preparing data Prepare data for clustering. 7 min
  2. 2 Training KMeans Train a KMeans model. 7 min
  3. 3 Label analysis Analyze cluster labels. 7 min
  4. 4 Printing results Print clustering results. 7 min
13
PCA
6 lessons · 31 min
  1. 1 What is PCA? PCA reduces dimensions while preserving the most variance in data. 5 min
  2. 2 Variance PCA selects components that explain the most variance. 5 min
  3. 3 n_components n_components sets the number of dimensions to reduce to. 5 min
  4. 4 fit_transform fit_transform trains PCA and transforms the data. 5 min
  5. 5 explained_variance_ explained_variance_ gives the variance ratio of each component. 5 min
  6. 6 Summary - PCA In this group you learned PCA, variance, and n_components. 6 min
14
Dimensionality reduction
6 lessons · 31 min
  1. 1 What is dimensionality reduction? Dimensionality reduction reduces feature count while preserving information. 5 min
  2. 2 Why reduce? Dimensionality reduction reduces computation cost and filters noise. 5 min
  3. 3 PCA vs t-SNE PCA is linear, t-SNE is a non-linear dimensionality reduction method. 5 min
  4. 4 Visualization Dimensionality reduction helps visualize high-dimensional data in 2D or 3D. 5 min
  5. 5 Advantages Dimensionality reduction reduces overfitting and increases model speed. 5 min
  6. 6 Summary - Dimensionality reduction In this group you learned PCA, t-SNE, and dimensionality reduction advantages. 6 min
15
Feature selection
6 lessons · 31 min
  1. 1 What is feature selection? Feature selection simplifies the model by choosing the most informative features. 5 min
  2. 2 Variance threshold Variance threshold removes low-variance features. 5 min
  3. 3 SelectKBest SelectKBest selects the top k features based on a statistical test. 5 min
  4. 4 Recursive elimination RFE recursively removes the least important feature. 5 min
  5. 5 Feature importance Tree-based models compute feature importance. 5 min
  6. 6 Summary - Feature selection In this group you learned variance threshold, SelectKBest, and RFE. 6 min
16
Imbalanced data
6 lessons · 31 min
  1. 1 What is imbalanced data? Imbalanced data has classes with unequal numbers of examples. 5 min
  2. 2 SMOTE SMOTE generates synthetic samples for the minority class. 5 min
  3. 3 Class weight The class_weight parameter gives more weight to the minority class. 5 min
  4. 4 Oversampling Oversampling duplicates minority class samples. 5 min
  5. 5 Metric selection For imbalanced data, F1 or AUC is used instead of accuracy. 5 min
  6. 6 Summary - Imbalanced data In this group you learned SMOTE, class_weight, and metric selection. 6 min
17
Project: FeaturesProject
4 lessons · 28 min
  1. 1 Feature extraction Derive new features. 7 min
  2. 2 Feature selection Select the best features. 7 min
  3. 3 Training model Train a model with selected features. 7 min
  4. 4 Evaluation Evaluate the model. 7 min
18
Ensemble methods
6 lessons · 31 min
  1. 1 What is ensemble? Ensemble combines predictions from multiple models for better results. 5 min
  2. 2 Voting Voting ensemble lets models decide by majority vote. 5 min
  3. 3 Bagging Bagging averages predictions from parallel models. 5 min
  4. 4 Boosting Boosting lets sequential models correct each other's errors. 5 min
  5. 5 Stacking Stacking combines model predictions with a meta-model. 5 min
  6. 6 Summary - Ensemble In this group you learned voting, bagging, boosting, and stacking. 6 min
19
Regularization
6 lessons · 31 min
  1. 1 What is regularization? Regularization prevents overfitting by penalizing model complexity. 5 min
  2. 2 L1 (Lasso) L1 regularization performs feature selection by shrinking coefficients to zero. 5 min
  3. 3 L2 (Ridge) L2 regularization shrinks coefficients but doesn't zero them. 5 min
  4. 4 alpha The alpha parameter controls regularization strength. 5 min
  5. 5 ElasticNet ElasticNet combines L1 and L2 regularization. 5 min
  6. 6 Summary - Regularization In this group you learned L1, L2, and ElasticNet regularization. 6 min
20
Intermediate finalFinal
4 lessons · 32 min
  1. 1 Challenge 1 Perform classification with scikit-learn. 8 min
  2. 2 Challenge 2 Evaluate a model with cross-validation. 8 min
  3. 3 Challenge 3 Perform clustering with KMeans. 8 min
  4. 4 Challenge 4 Reduce dimensions with PCA. 8 min

Neural networks, PyTorch, CNN, RNN, LSTM and transfer learning.

1
Neural network basics
6 lessons · 31 min
  1. 1 What is a neural network? A neural network is a layered model inspired by biological neural networks. 5 min
  2. 2 Neuron A neuron multiplies inputs by weights and applies an activation function. 5 min
  3. 3 Layers A neural network has input, hidden, and output layers. 5 min
  4. 4 Activation Activation functions add non-linearity, with ReLU being the most common. 5 min
  5. 5 Forward propagation Forward propagation is the input passing through layers to produce output. 5 min
  6. 6 Summary - Neural network In this group you learned neurons, layers, activation, and forward propagation. 6 min
2
PyTorch basics
6 lessons · 31 min
  1. 1 What is PyTorch? PyTorch is a deep learning library developed by Facebook. 5 min
  2. 2 Tensor A tensor is PyTorch's core data structure, a multi-dimensional array. 5 min
  3. 3 Creating tensors A tensor is created from a list with torch.tensor(). 5 min
  4. 4 Tensor properties A tensor has shape, dtype, and device properties. 5 min
  5. 5 GPU support PyTorch moves tensors to GPU for fast computation. 5 min
  6. 6 Summary - PyTorch In this group you learned tensor creation, properties, and GPU support. 6 min
3
Tensor operations
6 lessons · 31 min
  1. 1 Tensor operations Addition, multiplication, and reshape operations are done on tensors. 5 min
  2. 2 Shape A tensor's shape gives dimension information. 5 min
  3. 3 Dtype Dtype specifies the data type of tensor elements. 5 min
  4. 4 Reshape reshape() and view() change the tensor's shape. 5 min
  5. 5 Indexing Tensor elements are accessed by index. 5 min
  6. 6 Summary - Tensor operations In this group you learned tensor shape, dtype, and reshape operations. 6 min
4
Autograd
6 lessons · 31 min
  1. 1 What is autograd? Autograd automatically computes gradients of tensor operations. 5 min
  2. 2 requires_grad requires_grad=True enables gradient tracking for a tensor. 5 min
  3. 3 backward() The backward() method computes gradients from the loss. 5 min
  4. 4 grad The grad property contains the computed gradients. 5 min
  5. 5 Computational graph Autograd records operations as a computational graph. 5 min
  6. 6 Summary - Autograd In this group you learned autograd, requires_grad, and backward(). 6 min
5
Project: Neural networkProject
4 lessons · 28 min
  1. 1 Preparing tensors Convert training data to tensors. 7 min
  2. 2 Model definition Define a model with nn.Module. 7 min
  3. 3 Loss computation Compute MSE loss. 7 min
  4. 4 Optimizer Create an SGD optimizer. 7 min
6
nn.Module
6 lessons · 31 min
  1. 1 What is nn.Module? nn.Module is the base class for all neural network models. 5 min
  2. 2 __init__ Layers are defined in the __init__ method. 5 min
  3. 3 forward The forward method defines how data passes through the model. 5 min
  4. 4 nn.Linear nn.Linear creates a fully connected layer. 5 min
  5. 5 parameters() The parameters() method returns the model's learnable parameters. 5 min
  6. 6 Summary - nn.Module In this group you learned nn.Module, __init__, forward, and nn.Linear. 6 min
7
Training loop
6 lessons · 31 min
  1. 1 Training loop The training loop feeds data to the model and reduces loss. 5 min
  2. 2 Epoch An epoch is one complete pass through all training data. 5 min
  3. 3 Loss Loss measures how wrong the model's predictions are. 5 min
  4. 4 backward() The backward() method computes gradients from the loss. 5 min
  5. 5 optimizer.step() optimizer.step() updates weights with gradients. 5 min
  6. 6 Summary - Training loop In this group you learned epoch, loss, backward, and optimizer. 6 min
8
CNN
6 lessons · 31 min
  1. 1 What is CNN? CNN is a deep learning model successful in image processing. 5 min
  2. 2 Conv2d Conv2d uses a kernel to scan for patterns in images. 5 min
  3. 3 MaxPool2d MaxPool2d reduces image size and preserves important features. 5 min
  4. 4 Feature map The Conv2d output is a learned feature map. 5 min
  5. 5 Flatten Flatten reduces multi-dimensional feature maps to one dimension. 5 min
  6. 6 Summary - CNN In this group you learned Conv2d, MaxPool2d, and feature maps. 6 min
9
RNN
6 lessons · 31 min
  1. 1 What is RNN? RNN is a model designed to process sequential data. 5 min
  2. 2 Hidden state Hidden state is the RNN's memory from the previous step. 5 min
  3. 3 Sequence RNN steps through the sequence, updating hidden state at each step. 5 min
  4. 4 Vanishing gradient RNNs suffer from vanishing gradients on long sequences. 5 min
  5. 5 Embedding The embedding layer converts word indices to dense vectors. 5 min
  6. 6 Summary - RNN In this group you learned RNN, hidden state, and vanishing gradients. 6 min
10
LSTM
6 lessons · 31 min
  1. 1 What is LSTM? LSTM is an RNN type that preserves memory over long sequences. 5 min
  2. 2 Gates LSTM controls information flow with input, forget, and output gates. 5 min
  3. 3 Cell state Cell state is the LSTM's long-term memory carrier. 5 min
  4. 4 input_size input_size is the dimension of the feature vector entering the LSTM. 5 min
  5. 5 hidden_size hidden_size is the dimension of the LSTM's hidden state vector. 5 min
  6. 6 Summary - LSTM In this group you learned LSTM, gates, and cell state. 6 min
11
Project: CNNProject
4 lessons · 28 min
  1. 1 Preparing data Convert image data to tensors. 7 min
  2. 2 CNN model Define a CNN with Conv2d and MaxPool2d. 7 min
  3. 3 Loss and optimizer Use CrossEntropy loss and SGD optimizer. 7 min
  4. 4 Training Write a training loop. 7 min
12
Transfer learning
6 lessons · 31 min
  1. 1 What is transfer learning? Transfer learning adapts a pre-trained model to a new task. 5 min
  2. 2 Pre-trained model A pre-trained model is trained on a large dataset with shared weights. 5 min
  3. 3 Fine-tuning Fine-tuning retrains some layers of a pre-trained model. 5 min
  4. 4 Feature extraction Feature extraction freezes the pre-trained model's feature extraction layers. 5 min
  5. 5 Advantages Transfer learning provides high performance with little data. 5 min
  6. 6 Summary - Transfer learning In this group you learned pre-trained models, fine-tuning, and feature extraction. 6 min
13
Optimization
6 lessons · 31 min
  1. 1 What is an optimizer? An optimizer updates model weights using gradients. 5 min
  2. 2 SGD SGD updates weights on each example. 5 min
  3. 3 Adam Adam updates gradients with adaptive learning rates. 5 min
  4. 4 Learning rate Learning rate determines how much weights change each step. 5 min
  5. 5 zero_grad() zero_grad() resets gradients at each step. 5 min
  6. 6 Summary - Optimization In this group you learned SGD, Adam, and learning rate. 6 min
14
Advanced finalFinal
4 lessons · 32 min
  1. 1 Challenge 1 Perform tensor operations with PyTorch. 8 min
  2. 2 Challenge 2 Define a model with nn.Module. 8 min
  3. 3 Challenge 3 Build an image model with CNN. 8 min
  4. 4 Challenge 4 Write a training loop. 8 min

Transformers, attention, BERT, GPT, generative models and MLOps.

1
Attention
6 lessons · 31 min
  1. 1 What is attention? Attention lets the model focus on important parts of the input. 5 min
  2. 2 Self-attention Self-attention computes the relationship of each element with all others. 5 min
  3. 3 Query, Key, Value Attention computes weights from query-key products and sums values. 5 min
  4. 4 Scaled dot-product Scaled dot-product attention divides the query-key product by the square root of dimension. 5 min
  5. 5 Multi-head Multi-head attention runs multiple attention heads in parallel. 5 min
  6. 6 Summary - Attention In this group you learned self-attention, QKV, and multi-head attention. 6 min
2
Transformer
6 lessons · 31 min
  1. 1 What is a transformer? A transformer is a sequence model based on the attention mechanism. 5 min
  2. 2 Encoder The encoder processes input with attention and feed-forward layers. 5 min
  3. 3 Decoder The decoder uses encoder output and previous outputs to generate predictions. 5 min
  4. 4 Positional encoding Positional encoding gives the model position information in the sequence. 5 min
  5. 5 TransformerEncoderLayer nn.TransformerEncoderLayer represents a single encoder block. 5 min
  6. 6 Summary - Transformer In this group you learned encoder, decoder, and positional encoding. 6 min
3
Project: TransformerProject
4 lessons · 28 min
  1. 1 Preparing data Convert sequence data to tensors. 7 min
  2. 2 Attention layer Add a multi-head attention layer. 7 min
  3. 3 Encoder block Define a transformer encoder block. 7 min
  4. 4 Results Print the model output. 7 min
4
BERT
6 lessons · 31 min
  1. 1 What is BERT? BERT is a bidirectional language understanding model based on transformers. 5 min
  2. 2 Masked LM BERT masks random words during training and predicts them. 5 min
  3. 3 Tokenization BERT splits words into subword tokens. 5 min
  4. 4 Fine-tuning BERT is fine-tuned for tasks like classification. 5 min
  5. 5 CLS token The CLS token carries a summary of the entire sequence for classification tasks. 5 min
  6. 6 Summary - BERT In this group you learned BERT, masked LM, and fine-tuning. 6 min
5
GPT
6 lessons · 31 min
  1. 1 What is GPT? GPT is an autoregressive text generation model. 5 min
  2. 2 Autoregressive GPT generates text by predicting the next token from previous ones. 5 min
  3. 3 Decoder-only GPT is a transformer with only decoder blocks. 5 min
  4. 4 Causal mask Causal mask lets GPT see only previous tokens. 5 min
  5. 5 Text generation GPT generates text with greedy or beam search. 5 min
  6. 6 Summary - GPT In this group you learned GPT, autoregressive generation, and causal masks. 6 min
6
GAN and VAE
6 lessons · 31 min
  1. 1 What is GAN? GAN is a generative model where a generator and discriminator compete. 5 min
  2. 2 Generator The generator produces realistic data from random noise. 5 min
  3. 3 Discriminator The discriminator distinguishes real from fake data. 5 min
  4. 4 What is VAE? VAE is a generative model that encodes data into a probabilistic distribution. 5 min
  5. 5 Encoder-Decoder VAE uses an encoder for distribution parameters and a decoder for data generation. 5 min
  6. 6 Summary - GAN and VAE In this group you learned GAN and VAE generative models. 6 min
7
Reinforcement learning
6 lessons · 31 min
  1. 1 What is RL? Reinforcement learning is a method where an agent learns by maximizing rewards. 5 min
  2. 2 Agent An agent selects actions by interacting with an environment. 5 min
  3. 3 Policy Policy is the agent's strategy for selecting actions based on state. 5 min
  4. 4 Reward Reward is a signal showing how good the agent's action was. 5 min
  5. 5 Q-learning Q-learning is an RL algorithm that learns state-action values. 5 min
  6. 6 Summary - RL In this group you learned agent, policy, reward, and Q-learning. 6 min
8
Expert finalFinal
4 lessons · 32 min
  1. 1 Challenge 1 Apply the attention mechanism. 8 min
  2. 2 Challenge 2 Define a transformer encoder. 8 min
  3. 3 Challenge 3 Define a GAN generator. 8 min
  4. 4 Challenge 4 Define an RL agent policy. 8 min

Lessons are free, an account keeps your progress

You do not have to sign up. If you do, you continue where you left off and never lose your work.

  • Progress saved on every device
  • Earn XP and badges
  • Keep your daily streak
  • Get a certificate when you finish
create a free account

Frequently asked questions

Are the Machine Learning lessons free?

Yes. All 346 lessons of the Machine Learning course are free and you can start without an account.

Do I need any prior knowledge?

No. The beginner level starts from zero; a browser is all you need. If you already know the basics, start at a higher level.

How long does the course take?

Lessons take 2–8 minutes. The whole course is about 32 hours; with 15–20 minutes a day you can finish in a few months.

Do I get a certificate?

Yes. When you complete the course with a free account, a verifiable certificate is issued in your name.

Will I lose my progress without an account?

Without an account your progress is kept only in your current browser. When you create a free account it is moved to your account.

Next step Game Development

Learn game development from scratch with Unity and Godot. C# scripts, GDScript, physics, animation, audio and shipping.