
Formulate a model template, such as y = r^x, learn from data, and train to minimize error by selecting the best supervised model through a data-driven learning process.
Fit a model to data to forecast future epidemic evolution beyond observed data. Emphasize extrapolation with trust in the exponential assumptions to guide decisions such as interventions or recommendations.
AlphaZero learns move value from simulated games using a human-designed template, showing that human-encoded template assumptions drive performance.
Uncover why to use machine learning: automate parameter search for complex models, let data drive decisions, and reveal new insights you’d miss, with examples from recommendations and image analysis.
Summary notes of this lecture.
Explore linear regression for predicting continuous insurance claims in a real-world Insure Me scenario. Learn how X features map to Y claims through training on historical data.
Learn how supervised learning uses true labeled data during training to predict claims from client features, and how inference uses the trained model to estimate future claims quickly.
Master the machine learning recipe: define a template with learnable parameters, measure error with a loss, and train to minimize it in linear regression, with inputs like rooms and age.
Explore linear, nonlinear, and proportional relations with real-world examples—car rental thresholds, tax structures, and commissions—and connect these to linear regression concepts and the intercept.
Revisit the linear regression model template, showing y hat equals b plus sum of w i x i and the dot product of W and X for x1 through x5.
Compare mean absolute error and mean squared error as loss functions. Understand how the choice affects model training and evaluation for regression tasks.
Explore when to use a linear model by weighing assumptions, opportunities for insights from coefficients, and the value of explainability, while noting limits and where transformations may help.
Min-max scaling maps data to the 0–1 range by subtracting the minimum and dividing by the range. For example, a size of 1000–4500 becomes 0–1.
Explore min-max scaling with pandas to scale each feature independently, train a linear regression on the scaled data, and compare outcomes with mean squared error.
Assess the problems of min-max scaling, notably its distortion by outliers and keeping targets unscaled, then consider alternative input scaling approaches for better interpretation.
Compare coefficients before and after scaling to see how scaling alters magnitudes and the intercept in claims prediction. Scaled zero equals average inputs, making the intercept reflect a typical client.
During inference, scale new inputs with the training data's mean and standard deviation, not row-specific values, and remember these statistics to ensure consistent predictions.
Apply L2 regularization to penalize large weights via the alpha hyperparameter. Scale features with standard scaling so weights are comparable, while the intercept remains unregularized.
Drive L1 regularized linear regression with varying alphas to zero out some features, discarding phone numbers and house size, while validation seeks a sweet spot to balance error and overfitting.
Learn why evaluating models on training data misleads about performance, and use held-out data to compare regularized and unregularized models, guarding against overfitting and improving generalization.
Split data into training, validation, and test sets; train a pipeline on the training data, scale with the training mean and std, and assess out-of-sample generalization on the validation set.
Use the validation set to perform hyperparameter tuning across model templates, comparing L1 and L2 regularization with different alphas via grid search, to select the best model and estimate generalization.
Recognize that model selection is biased and cherry-picking models can yield luck-based performance, while repeated use of the validation set taints data and biases out-of-sample estimates.
Show how the test set yields a binary verdict after training on the training set and validating with alphas, avoiding monkey-typewriter pitfalls, ensuring unseen data and predefined acceptance criteria.
Design experiments in advance and split data into training and validation sets to minimize being fooled by randomness, guided by the no free lunch theorem and cross-validation to estimate performance.
Use cross-validation with multiple folds (typically five or ten) to train models in Python and average results to reduce variance. Reserve a test set at the end for model selection.
Explore AutoML with h2o, which automates model selection by trying multiple templates, ensembles, and fivefold cross-validated performance, and even generates new features by multiplying feature pairs.
Use feature importance after training to spot data leakage and assess if the model relies on suspicious inputs, like basket size, via linear model coefficients.
Highlight how data leakage creates perfect accuracy by using a feature whose digit count varies with the target class, revealing the model memorized a spurious rule.
Avoid random splits of dependent data to prevent leakage from correlated animal pictures into training and validation, avoiding overfitting by splitting data by animal.
Identify look-ahead bias as a common pitfall where future information leaks into predictions. Avoid aggregated time-series features that reveal November prices early, which cheats the model’s training and deployment.
Explore two look-ahead bias solutions: using the previous year's monthly average to capture seasonality, and applying a 30-day rolling average before the purchase date.
Master temporally aware cross-validation for time-series data by training on prior periods and validating on later months with rolling or sliding windows, for robust model selection and tuning.
Learn how predicting purchases does not prove a model understands price sensitivity, and why causal inference and counterfactuals require separate validation before using a model for new tasks.
Classify images of handwritten digits using a pixel-based representation by flattening 28x28 grayscale images into rows of 784 pixel values, trained on the Amnesty dataset (60,000 training, 10,000 test).
Learn why binary classification uses a single output and deduces the other class, while multiclass requires K outputs and a self max function to combine probabilities.
Maximize the log likelihood by transforming products into sums for numerical stability, then minimize the negative log likelihood or cross entropy as the loss function.
Analyze negative log-likelihood across scenarios from an unsure model (0.25 per class) to confidently wrong and perfectly right predictions; note infinity for total wrongness and zero for perfect rightness.
In logistic model, there is no closed form solution to obtain optimal parameters; instead evaluate the cross entropy loss for parameter sets with a trial and error approach.
Navigate a foggy terrain to minimize the loss function using gradient descent: start from a random parameter point, move along the steepest descent, and repeat until reaching a valley.
Visualize gradient descent as moving through a topographic loss map, taking short steps in the direction of steepest descent until the surface looks flat, reaching the valley.
Learn to compute the gradient of the loss as a vector of partial derivatives across all model parameters, guiding the fastest ascent or descent toward optimal weights and biases.
Explore binary classification concepts, identify the positive and negative classes, interpret y hat probabilities, and examine class imbalance with fraud detection datasets.
Explore sensitivity and specificity in binary classification, including how many positives and negatives are correctly identified, and the tradeoff with recall, precision, and thresholds.
Explore how roc curves assess classifier performance across thresholds, plotting sensitivity versus one minus specificity, and relate this to precision and recall across many thresholds.
Explore designing a custom business metric to maximize recall on imbalanced data, set thresholds for 90% recall of fraudulent transactions, and compare logistic and gradient boosted trees for precision gains.
This course will teach you the foundations of machine learning. The content was especially designed to help you pass machine learning interviews for data science jobs.
The course will help you:
Pass job interviews and technical quizzes
Avoid rookie mistakes that waste companies' time and money
Be prepared for real work.
Important stuff about this course:
You won't spend hours learning stuff that never comes up in a job interview.
Total beginners are welcome; coding experience or advanced math knowledge are not required.
It was designed by an industry expert who's been on the hiring side of the table and knows what companies are looking for.
This course will be of great help if you are:
A student who wants to prepare for work in data science after graduating.
An established professional or academic who wants to switch careers to data science.
A total beginner who wants to dabble in machine learning and data science for the first time.
How is this different from an academic course or a bootcamp?
In academic courses, your teacher spends hours speaking about calculus and linear algebra, but then none of that comes up in a job interview! That in-depth knowledge certainly has a place but is not what most companies are looking for.
In bootcamps you tend to learn how to use many tools but not how they work under the hood. This black-box knowledge is what companies want to avoid the most in applicants!
This course sits in between—you gain foundational knowledge and truly understand machine learning, without spending time on unimportant stuff.