Machine Learning in Python
About This Course
Machine learning is a set of methods for making predictions from data, and scikit-learn is the library most Python teams use to apply them. This course takes you from the Python language itself to models you can defend: the programming, the data handling, the numerical work, and then the modelling that depends on all three.
The first half is about getting data under control. Day 1 teaches Python through worked examples rather than syntax tables, and enough of Jupyter that the notebook stops getting in your way. Day 2 goes after the data where it actually lives — a spreadsheet, a Parquet file, a database, an API behind a rate limit — and covers reading it, cleaning it, and charting it so the shape of a problem is visible before you model it.
Day 3 is the numerical groundwork. NumPy underlies every modelling library you will touch, so you spend time on arrays, broadcasting and the linear algebra that makes the rest make sense, then on simulation, regression, clustering and anomaly detection. Day 4 is scikit-learn end to end. It gives real time to validation and feature engineering, because those separate a model that works from one that only looked good on the training set. It finishes with putting a trained model into production, and noticing when the world moves away from the data it was fitted on.
Datasets are drawn from a range of industries, and you write code in every section.
Who This Course Is For
Analysts, engineers, scientists and researchers who need to build predictive models but do not yet write Python. It suits people who currently do this work in spreadsheets, in another language, or with a tool that has run out of room, and who want a single course covering the language, the data handling and the modelling rather than a slice of it.
It also suits teams where modelling is currently done by one or two people and everyone else waits on them, and teams who have models in a notebook but nothing running anywhere a colleague can reach. If your people already write Python and use Pandas or Polars, Python Charmers' Python for Machine Learning course covers the modelling alone in a shorter format.
Prerequisites
Some familiarity with programming concepts in any language is helpful, but prior programming experience is not required. You do not need to have written Python before.
No prior machine learning experience is expected, and no mathematics beyond what your own work already requires. You do not need to derive an algorithm to use one well, and we do not ask you to.
What You'll Learn
- Write Python to load, clean and reshape the data your work depends on.
- Move data between the formats and systems your organisation already uses, including Excel workbooks, Parquet files, SQL databases and web APIs.
- Build regression, classification and clustering models with scikit-learn, using the same estimator interface across all three.
- Validate a model honestly with held-out data and cross-validation, and read the learning and validation curves that show where it is failing.
- Engineer features from messy data, and find the outliers and anomalies that distort results.
- Put a trained model into production, and test it for the dataset shift that degrades it over time.
Course Syllabus
Day 1: Python basics
- The core language, taught through worked examples
- Functions, keyword arguments and exceptions
- Lists, dictionaries and the further data types you will need
- Modules, packages, files and paths
- Working effectively in Jupyter: cells, kernels and keyboard shortcuts
- Producing automated reports from a notebook
Day 2: Handling, analysing and presenting data
- Tabular data analysis with Pandas or Polars
- The common data formats: CSV, Excel, Parquet and JSON
- Retrieving data from databases with SQLAlchemy Core and the ORM
- Retrieving data from web APIs, and working within rate limits
- Cleaning data and handling missing values
- Interactive visualisation with Plotly Express
Day 3: Further data analytics
- Array and matrix computing with NumPy: indexing, views and broadcasting
- Linear algebra, eigenvalues and transformation matrices
- Simulation with Monte Carlo sampling and the bootstrap
- Uncertainty and confidence intervals
- Multiple linear regression, design matrices and categorical data
- Cluster analysis, including satellite imagery and text
- Outlier and anomaly detection with K-means, DBSCAN and pyOD
Day 4: Machine learning
- Regression, classification and time-series forecasting
- The scikit-learn estimator interface, and choosing an estimator
- K-nearest neighbours, applied to handwritten digits and bank marketing data
- Validation and scoring: cross-validation, overfitting and underfitting
- Diagnostics: confusion matrices, learning curves and Yellowbrick
- Feature engineering and selection, pipelines and ColumnTransformer
- Putting models into production, and testing for dataset shift