
Explore the basics of supervised machine learning in Python, from theoretical foundations to practical, step-by-step coding with cross-validation, hyperparameter tuning, and ensemble models.
Explore how supervised learning uses features and a target to train a model on a training data set and predict the target for new data by minimizing a cost function.
Distinguish regression and classification in supervised learning, using numeric targets, categorical targets, and binary cases, with cost functions like mean squared error and cross entropy.
Learn how supervised models generalize from training data to unseen data, avoiding overfitting and underfitting by choosing intermediate model complexity and proper train-test splits.
Explore how Jupyter notebooks empower data science work by running code cell by cell, mixing Markdown with Python, and visualizing charts in an interactive, shareable notebook.
Explore the scikit-learn API for supervised learning in Python, learning model classes, hyperparameters, and how to fit, predict, and manage X and y datasets with example datasets.
Learn how linear regression uses a linear combination of features to predict the target and minimize the cost function, and how feature selection reduces collinearity.
Learn to implement linear regression in Python: load the diabetes dataset, split the data into training and test sets, fit a LinearRegression model, then predict and inspect coefficients and intercept.
Ridge regression adds an L2 penalty to linear regression, controlled by alpha to shrink coefficients and reduce overfitting, with scaling via standardization or normalization required.
Explore ridge regression in Python by using a diabetes data set, scaling features with a standard scaler, splitting data, and fitting a model with alpha, then predicting and inspecting coefficients.
Explore lasso regression, a linear model with an l1 penalty that shrinks coefficients, enables automatic feature selection, and depends on alpha tuning and proper feature scaling.
Learn how to implement lasso regression in Python using the linear model module, scale data with StandardScaler, train on the diabetes dataset, and tune the alpha parameter for feature selection.
Explore elastic net regression, blending L1 and L2 penalties to reduce overfitting, tune alpha and the R mixing parameter, and scale features for robust linear modeling.
Import the diabetes dataset, apply elastic net regression in Python, scale features with StandardScaler, split the data, and tune alpha and l1_ratio for optimal regularization.
Explore logistic regression for binary and multiclass classification, using a sigmoid function on a linear model. Learn why feature scaling matters to avoid vanishing gradients and to enable robust training.
Master logistic regression in Python for binary and multiclass classification, scaling with a standard scaler, training, predicting probabilities, and tuning hyperparameters like C and iterations.
Explore binary decision trees that model feature relationships to predict targets using purity-driven splits and leaves. See how thresholds and information gain guide splits for classification and prediction in regression.
Learn to build decision tree classifiers and regressors in Python, including loading data, train-test split, fitting, predicting, and tuning key hyperparameters such as criterion, max depth, and min samples split.
Explore the k-nearest neighbors method, a simple instance-based classifier and regressor that uses Euclidean and Minkowski distances, with a configurable k, distance weighting, and feature scaling before training.
Demonstrate k nearest neighbors for classification and regression, using iris and diabetes datasets, scaling features, tuning neighbors and distance weights, and interpreting predicted classes and values.
Use naive Bayes to predict the target y from features by multiplying conditional probabilities under the independence assumption, selecting the class with the highest probability from training data.
Learn to implement categorical Naive Bayes in Python by converting numerical iris features into categorical bins, encoding them, training the model, and predicting with probabilities.
Demonstrate Bernoulli Naive Bayes for binary features by thresholding inputs into binary values. Explain training, prediction, and the role of a binary transformer in a pipeline using the iris dataset.
Explore Gaussian Naive Bayes for numerical features by modeling conditional probabilities with a gaussian distribution, then train and predict on a split dataset using predict_proba.
Explore support vector machines, their hyperplane separating feature space, and kernel functions—from linear to polynomial and radial basis function—covering classification, regression, and practical feature scaling.
Implement linear support vector machines in Python with a linear kernel for classification and regression. Scale features, split data, and tune C and max iterations to generate predictions.
Explore non-linear support vector machines in Python by applying linear, polynomial, radial basis function, and sigmoid kernels, scaling features, and evaluating classification and regression with iris and diabetes data.
Explore neural networks from the perceptron model to fully connected feed-forward architectures, including activation functions, backpropagation, stochastic gradient descent, and learning for regression and classification.
Explore how neural networks classify with the MLP classifier and predict with the MLP regressor. Learn scaling with StandardScaler, splits, and how activation, epochs, and learning rate affect training.
Explore how ensemble models combine multiple predictions to reduce bias and variance and boost accuracy, using boosting, bagging, voting, and stacking as core techniques.
Explore bagging, a technique that reduces variance by training multiple identical models on bootstrap samples with random feature subsets. In regression, average predictions; in classification, soft or hard voting.
Explore bagging in python for classification and regression, using logistic regression and linear regression as weak learners, with scaling, bootstrapping, soft voting, and diabetes dataset examples.
Explore how random forest builds multiple decision trees using bootstrap samples and random feature selection to reduce variance and mitigate overfitting.
Learn to implement random forest classifiers and regressors in Python, load Iris and diabetes data, split data, fit models, make predictions, and tune hyperparameters like n_estimators, max_features, bootstrap, and n_jobs.
Explore extremely randomized trees, or extra trees, a bootstrap-free model that uses randomly chosen split points and random feature subsets to reduce variance and limit overfitting while speeding training.
Explore extremely randomized trees in Python for classification and regression with iris and diabetes datasets; learn to configure n_estimators, max_features, max_samples, random_state, and parallelization, and compare to random forest.
In this practical course, we are going to focus on supervised machine learning and how to apply it in Python programming language.
Supervised machine learning is a branch of artificial intelligence whose goal is to create predictive models starting from a dataset. With the proper optimization of the models, it is possible to create mathematical representations of our data in order to extract the information that is hidden inside our database and use it for making inferences and predictions.
A very powerful use of supervised machine learning is the calculation of feature importance, which makes us better understand the information behind data and allows us to reduce the dimensionality of our problem considering only the relevant information, discarding all the useless variables. A common approach for calculating feature importance is the SHAP technique.
Finally, the proper optimization of a model is possible using some hyperparameter tuning techniques that make use of cross-validation.
With this course, you are going to learn:
What supervised machine learning is
What overfitting and underfitting are and how to avoid them
The difference between regression and classification models
Linear models
Linear regression
Lasso regression
Ridge regression
Elastic Net regression
Logistic regression
Decision trees
Naive Bayes
K-nearest neighbors
Support Vector Machines
Linear SVM
Non-linear SVM
Feedforward neural networks
Ensemble models
Bias-variance tradeoff
Bagging and Random Forest
Boosting and Gradient Boosting
Voting
Stacking
Performance metrics
Regression
Root Mean Squared Error
Mean Absolute Error
Mean Absolute Percentage Error
Classification
Confusion matrix
Accuracy and balanced accuracy
Precision
Recall
ROC Curve and the area under it
Multi-class metrics
Feature importance
How to calculate feature importance according to a model
SHAP technique for calculating feature importance according to every model
Recursive Feature Elimination for dimensionality reduction
Hyperparameter tuning
k-fold cross-validation
Grid search
Random search
All the lessons of this course start with a brief introduction and end with a practical example in Python programming language and its powerful scikit-learn library. The environment that will be used is Jupyter, which is a standard in the data science industry. All the Jupyter notebooks are downloadable.