Core ML
Classical ML, deep learning, training patterns, and foundations
Framing
- Core ML
What Is Machine Learning?
Instead of writing the rules yourself, you hand over examples and let a procedure find the function. What arrives alongside those examples splits the field.
- Core ML
ML Workflow: Six Stages in a Loop
Problem, data, model, evaluation, shipping and monitoring run in a loop, not a line. What monitoring finds reframes the problem instead of only retraining the model.
- Core ML
Overfitting and Underfitting
Underfitting is both curves high and flat. Overfitting is training loss still falling while validation loss turns up. You read it off curves, not off vibes.
- Core ML
Bias–Variance Tradeoff
Expected error splits into rigid bias, jumpy variance and noise you cannot remove, and adding capacity lowers the first while raising the second.
- Core ML
Statistical Learning Theory
A generalization bound caps how far true error can exceed training error — and the honest catch is that cap is usually far too loose to use as a real number.
- Core ML
Early Stopping
Watch validation loss and stop a few epochs after it bottoms out, then roll back to the best checkpoint. Training past that point memorizes noise instead of learning signal.
Evaluation
- Core ML
Model Evaluation
Scoring a model is four decisions and not one number: what it never saw, which mistake you count, where you cut the score, and who it quietly fails for.
- Core ML
Classification Metrics
Precision prices a false alarm, recall prices a miss, and one threshold moves both. Every number you report is a claim about which mistake you'd rather make.
- Core ML
Regression Metrics
Each metric prices mistakes differently. MAE charges every pallet equally while RMSE lets the worst day dominate the score.
- Core ML
Confusion Matrix
Four counts in one grid sort every prediction by what was said and what was true, and every classification score divides those cells.
- Core ML
Precision-Recall Curve
Neither axis counts the easy negatives you got right, so a mountain of obvious no cases cannot flatter the picture.
- Core ML
ROC and AUC
AUC measures one thing: the chance a random positive scores above a random negative. That's ranking quality, and it can't see calibration or class imbalance.
- Core ML
Threshold Selection
A score is not a decision. The cutoff that minimizes cost comes from the prices of the two mistakes, and 0.5 is just the default the library shipped.
- Core ML
Probability Calibration
Ranking tells you which van breaks first. Calibration tells you whether 0.85 really means 85 in 100.
Training
Regression
- Core ML
Linear Regression
Prediction is a weighted sum plus an intercept, fitted to make the leftover errors smallest. Those leftovers are the most useful thing the model hands back.
- Core ML
Ordinary Least Squares
Ordinary least squares finds the straight-line fit that makes squared misses as small as possible. Geometry says the leftover error stands at a right angle to every feature.
- Core ML
Polynomial Regression
Add powers of the input as features and a straight-line solver can draw curves. Bend it too far and it memorizes noise instead of the trend.
- Core ML
Generalized Linear Models
Least squares and logistic regression are one machine with two swap parts, a link and a noise family. Set them for counts and negatives vanish.
- Core ML
Multicollinearity
When two input features move almost identically, a regression splits credit between them almost arbitrarily. Coefficients swing wildly, but predictions barely move.
- Core ML
Gaussian Process Regression
Put a prior over whole functions instead of fixed weights, then let the data narrow it to curves that fit.
Classification
- Core ML
Logistic Regression
It classifies, despite the name. A linear score goes in, a sigmoid squeezes it down into a probability, and the log-odds come out straight in the features.
- Core ML
K-Nearest Neighbors
Store every training row and answer each query with a vote among its k closest rows. There is no training step, so the work and the memory bill both land at prediction time.
- Core ML
Naive Bayes
Treat every word as independent evidence for a class, multiply the per-word chances, and pick the largest product. The chances come out wrong but the winner is usually right.
- Core ML
Support Vector Machines
Of every line that splits two classes, keep the one farthest from the nearest point on each side. A few border points decide everything, and there is no probability in the answer.
- Core ML
The Kernel Trick
Some classifiers only ever need dot products between pairs of points. A kernel computes that number directly from the original features, so the huge expanded space never gets built.
Regularization
- Core ML
Ridge Regression
Add a penalty on coefficient size and the bias variance tradeoff becomes a dial. You accept a little bias on purpose to buy a much bigger drop in variance.
- Core ML
Lasso Regression
Penalise the absolute size of each coefficient and the penalty keeps full force at zero, so weak coefficients land exactly on it. Shrinkage becomes selection.
- Core ML
Elastic Net
One penalty picks a shortlist and a second penalty makes correlated features share weight. You keep the shortlist without letting noise decide which twin survives.
Trees
Ensembles
- Core ML
Random Forests
Bagged trees stall when one column dominates every split. Hide most of the columns at each split and the trees stop agreeing, which is when averaging pays.
- Core ML
Bagging
Fit the same twitchy model to many resamples of your own data, then average. Variance falls fast, then stalls, because the resamples overlap so heavily.
- Core ML
Boosting
Shallow trees take turns fixing the leftover error, each added at half strength. The chain cuts bias that parallel averaging can't touch.
- Core ML
AdaBoost
Fit a one-cut stump, make the rows it missed count for more, and fit again. The final call is a weighted vote where the accurate stumps speak louder.
- Core ML
Gradient Boosting
Ordinary gradient descent nudges parameters. Gradient boosting nudges the prediction itself, one small tree per step, fitted to the gradient of your loss.
- Core ML
Gradient-Boosted Tree Libraries
Production boosting libraries add three things to the algorithm: features bucketed into bins, the greediest leaf grown first, and categories encoded in order.
- Core ML
Stacking Ensemble Learning
Averaging models with fixed weights can't know which one to trust when. Train a meta-model on their predictions instead, and it learns the weighting for you.
- Core ML
Feature Importance
The importance your tree library prints for free answers a narrower question than it looks like. Permuting a column on held-out data answers the one you meant.
Unsupervised
- Core ML
K-Means
Point every observation at its nearest centre, move each centre to the mean of its points, and repeat. The total error always falls, but where it lands depends on where it started.
- Core ML
DBSCAN
A point with enough neighbours close by anchors a cluster, and clusters spread through those anchors, so shape is free and leftover points are called noise.
- Core ML
Hierarchical Clustering
Start with every point alone, then merge the two closest groups over and over and record each merge height. Cutting the resulting tree at one height gives you any number of clusters from a single run.
- Core ML
Gaussian Mixture Models
Your data came from several bell curves mixed together. Fitting finds each curve, and every point gets a share of each one.
- Core ML
Principal Component Analysis
Turn the axes until the first runs along the widest spread, then drop the flat directions that carry almost nothing.
- Core ML
t-SNE
It keeps neighbours together and protects nothing else, so the gaps between the clusters you can see, and the sizes of those clusters, carry no information.
- Core ML
UMAP
Build a neighbour graph, scale each point's edges by its own nearest neighbour, then lay the graph out. Faster than t-SNE, and the gaps still are not distances.
- Core ML
Anomaly Detection
Most rows are ordinary and a few are strange in ways you cannot list in advance, so you score each row for strangeness and flag whatever passes a cutoff.
- Core ML
Isolation Forest
Cut the data with random splits and count how many cuts each point needs before it sits alone. Odd points fall away in a few cuts, typical points take many, so the count itself is the anomaly score.
- Core ML
One-Class SVM
Learn one closed wall around normal examples only, then flag anything outside it as novel without ever seeing what abnormal looks like.
- Core ML
Clustering Evaluation: Scores Without Labels
No answer key exists for clusters, so each score defines good in its own way. The same grouping can please one score and fail another.
- Core ML
Association Rule Mining
Support counts how often items appear together, confidence measures how reliably one predicts another, and lift checks whether that beats pure chance.
- Core ML
Matrix Factorization
Rebuild a mostly empty ratings grid as the product of two small tables. Fit only on cells you saw and every blank cell inherits a prediction for free.
Evaluation Science
- Core ML
Calibration
A 90% claim should be right nine times in ten. Calibration checks whether it is, and fixes the gap when it is not.
- Core ML
Conformal Prediction
A single label pretends you are sure. Conformal prediction returns a small set of labels that holds the truth about eight times in ten, and the set grows when the model is unsure.
- Core ML
Permutation Feature Importance
Shuffle one column of held-out data and watch the score fall. A big drop means the model leaned on that feature, and almost no drop means it did not.
- Core ML
Model Explainability (XAI)
A denied loan needs a reason a person can act on. Explainability splits one prediction into per feature credits so income, debt and age each own a signed share.
- Core ML
SHAP Values
Split one prediction into a credit per feature, averaged over every order the features could arrive in. The credits always add up to the prediction exactly.
- Core ML
LIME
You cannot explain a complex model globally, but zoomed in close on one prediction the boundary looks like a straight line, and LIME fits a simple model to that small patch.
- Core ML
Partial Dependence and ICE
Importance says a feature matters. Partial dependence shows how it moves the prediction on average, and ICE shows how it moves each individual underneath that average.
- Core ML
Error Analysis
Read a sample of your model failures by hand, sort them into causes, and count each pile. The counts turn one opaque error rate into a ranked repair list.
- Core ML
Out-of-Distribution (OOD) Detection
A model only knows the world it trained on. OOD detection is the gate that scores each new input for foreignness and blocks it before the model may answer.
- Core ML
Aleatoric vs Epistemic Uncertainty
A model can be unsure for two reasons. Either the world itself is noisy, or the model has not seen enough. Only the second kind shrinks when you add data.
- Core ML
Deep Ensembles
Train the same network five times from different starting weights and let the members vote. When they agree you can answer, when they split you are guessing.
Validation
- Core ML
Learning Curves
Refit from scratch on growing training sizes and plot both errors. A closed flat gap says buy nothing, while a wide open one says data is the cheapest fix.
- Core ML
Validation Curves
Learning curves sweep data volume. Validation curves sweep one hyperparameter instead, and the U shape it traces diagnoses over and underfitting directly.
- Core ML
Hyperparameter Tuning
Training sets the weights, but you set the knobs around training such as depth and learning rate. Tuning is the search over those knob settings scored on data the model did not train on.
- Core ML
Bayesian Optimization
Each costly trial updates a cheap stand-in model that predicts both a score and its uncertainty everywhere, and the next trial goes where that map looks promising or genuinely unknown.
- Core ML
Nested Cross-Validation
Tune inside outer training rows only, then score the winner on a fold the search never saw, so the reported number predicts fresh data instead of grading its own homework.
- Core ML
Time Series Cross-Validation
Shuffling time-ordered rows lets a model study the future and predict the past. Honest validation trains only on rows that came before the ones it scores.
Production Ml And Llmops
- Core ML
Data Drift Detection
Today's inputs no longer look like training data, yet the model keeps answering with full confidence. Data drift detection compares the two windows bin by bin and raises the alarm before accuracy slides.
- Core ML
Concept Drift
The inputs look the same but the right answer changed, so a once accurate model starts missing. Concept drift is that broken link between features and labels.
- Core ML
Reproducibility in Machine Learning
Train the same code on the same data twice and you can get two slightly different models. Reproducibility is the discipline of locking down every source of randomness until the same inputs always give the same model.
- Core ML
Model Quantization for Serving
Weights stored at 16-bit precision can be rounded to 8 or 4 bits. The file shrinks about 4 times, serving gets cheaper and faster, and quality barely moves.
- Core ML
Distributed Training
One GPU cannot hold a 70-billion parameter model, so split the weights, the layers, or the data itself across many GPUs that train together as one machine.
- Core ML
Data Parallelism: Copies That Share One Update
Each GPU holds a full copy of the model and trains on its own slice of data, then all copies average their gradients and take the same step.
- Core ML
Tensor Parallelism
When one layer is too big for a single card, split the matrix itself. Each card multiplies its own half, and one collective adds the partial answers.
- Core ML
Pipeline Parallelism
Split a network by depth across GPUs like an assembly line. Each device runs its own layers and hands activations to the next, and micro-batches keep every station busy.
- Core ML
ZeRO & FSDP
Instead of every GPU holding a full model copy, each holds one shard and gathers the rest just in time, so cards pool memory instead of repeating it.
- Core ML
Activation Checkpointing
Training usually keeps every layer's output in memory for the backward pass. Checkpointing keeps only a few of them and rebuilds the rest on demand, trading about a third more compute for far less memory.
- Core ML
Experiment Tracking
Log the settings, code version, and data version behind every training run, then rank runs by score. The log turns the good model from a memory into a row you can rerun.
- Core ML
Model Monitoring
A deployed model fails silently, returning confident wrong answers while accuracy labels lag by days. Monitoring watches proxy metrics that move first and pages you before users notice.
- Core ML
Model Registry
Training ends with a file, serving starts with an approved version. A registry is the shelf between them, where every model is versioned, staged, and one pointer move from rollback.
- Core ML
Model Versioning
A model version pins code, data, and environment together. Rebuild any one of the three differently and you get a different model.
- Core ML
Feature Stores
Training reads features from a warehouse in minutes while the live app needs the same values in milliseconds. A feature store defines each feature once and serves identical values to both paths.
- Core ML
ML Pipeline Architecture: From Data to Registry
A notebook proves an idea once. A pipeline replays ingestion, preparation, training, evaluation and registration on schedule so the same code produces a fresh model without manual steps.
- Core ML
ML System Design in Six Gated Phases
Interviews ask how to build a news feed ranker or a fraud filter. Six phases in fixed order turn that open question into a defensible answer where each decision gates the next.
- Core ML
LLM Application Architecture
Calling an LLM API directly is not a production system. A real LLM application wraps that call in a stack of layers — gateway, cache, router, guardrails, and observability — each one solving a problem that raw inference can't.
- Core ML
Testing ML Systems
You cannot assert exact outputs from a probabilistic model. Test the data going in, the behavior rules that must hold, and the aggregate score on a locked golden set.
Networks
- Core ML
Perceptron
One neuron learning a boundary from its own mistakes and nothing else. It halts the instant nothing is wrong, and loops forever when no straight line exists.
- Core ML
Artificial Neuron
A neuron is a tiny vote counter. It weights each input, adds a small nudge, and passes the total through a bend to decide what to output.
- Core ML
Multi-Layer Perceptron
A hidden layer invents new coordinates, and in those coordinates one straight line is enough. Depth is a change of representation, not extra parameter room.
- Core ML
Activation Functions
The bend between layers that decides what passes and what dies. Its slope sets how much training signal reaches the early layers.
- Core ML
Loss Functions
Every common loss is the negative log-likelihood of some noise model, so picking one is a claim about how your data got its errors. Choose the claim first.
- Core ML
Backpropagation
One forward pass stores what each layer computed. One backward pass hands every parameter its gradient, because the gradients share almost all their work.
- Core ML
Weight Initialization
Random weights break symmetry between units, but the wrong scale shrinks every layer's output toward zero or blows it up, and the right scale depends on the layer's width.
- Core ML
Vanishing and Exploding Gradients
Backprop multiplies one derivative per layer, so values below one shrink toward zero and values above one blow up. The product decides whether early layers learn at all.
- Core ML
Exploding Gradients
The same layer-by-layer multiplication behind vanishing gradients runs the other way when local derivatives stay above one, and the gradient grows exponentially with depth instead of shrinking toward zero.
- Core ML
Gradient Clipping
Cap the gradient's size before the optimizer step, either by shrinking each entry to a fixed range or by rescaling the whole vector, so one bad batch can't throw the weights somewhere training never recovers from.
- Core ML
Dropout
Zero out a random slice of a layer on every training pass, and one set of weights quietly trains a huge family of thinned networks that vote at inference.
- Core ML
Weight Decay
Adding a squared-size penalty to the loss is the same as multiplying every weight by a shade under one each step. That equality breaks under Adam, so AdamW.
- Core ML
Batch Normalization
Each channel is recentered with its own batch mean and spread, then handed a learned scale and shift. At test time a running average stands in because the batch is gone.
- Core ML
Group Normalization
Split a layer's channels into fixed-size groups and normalise each group within one example, never across the batch, so a detector running two images per GPU normalises exactly as reliably as one running two hundred.
Attention
- Core ML
Feed-Forward Networks
After attention mixes information across positions, each position still needs its own nonlinear update. A feed-forward network widens it, bends it, then squeezes it back.
- Core ML
Layer Normalization
Standardise each example from its own features alone, never from the batch around it. The same sentence normalises identically whether it arrives solo or with ninety-nine others.
- Core ML
Self-Attention
Every token builds a query, a key, and a value, then scores its query against every key in the sequence to decide how much of each other token's value to blend in.
- Core ML
Cross-Attention
One decoder token scores its query against every encoder key, then blends encoder values by those weights, so generation reads a different sequence without merging the two.
- Core ML
Multi-Head Attention
Split the model width into several smaller subspaces and run an independent attention in each one, so different heads can track different kinds of relationship.
- Core ML
Causal Masking
Causal masking hides every future token before attention weights are computed, so each position can only blend in itself and the tokens before it.
- Core ML
Positional Encoding
Self-attention blends values with no sense of order, so each token gets a sine and cosine mark that says where it sits.
- Core ML
Rotary Position Embeddings
Instead of adding a position vector to every token, rotary embeddings rotate a token's query and key vectors by an angle tied to its position in the sequence.
- Core ML
Transformer Architecture
Stack blocks of self-attention plus a feed-forward network, each wrapped in a residual connection and normalization, and repeat that same block many times to build the whole model.
- Core ML
Encoder-Decoder Architectures
Three ways to arrange the same transformer block: read everything at once, generate one token at a time, or bridge both with cross-attention.
- Core ML
Vision Transformers
Vision Transformers slice an image into fixed-size patches, treat each one as a token, and run ordinary self-attention over that sequence of image tokens.
- Core ML
BERT: Bidirectional Encoder That Fills Masks
BERT reads the whole sentence at once and learns by filling in hidden words, so each word ends up carrying context from both sides.
- Core ML
GPT & Autoregressive Models
GPT reads strictly left to right and trains on exactly one job: guess the next word, over and over, which turns out to teach it far more than that sounds.
- Core ML
Mamba
Mamba lets each token turn its own dial on memory. Important tokens rewrite the state strongly while filler tokens pass through, so long sequences cost grows in a straight line.
- Core ML
State Space Models
A state space model compresses the entire past into a fixed-size hidden state that is updated one input at a time, giving linear-time inference without the quadratic score matrix that attention requires.
- Core ML
FlashAttention
Standard attention writes a huge score matrix to slow GPU memory and reads it back. FlashAttention works in small tiles that fit in fast on chip memory, so the result matches exactly with far less traffic.
- Core ML
Grouped-Query Attention
Instead of every head keeping its own keys and values or all heads sharing one pair, grouped-query attention splits heads into a handful of groups where each group shares a KV pair, keeping most of the cache saving with little quality loss.
- Core ML
Linear Attention
By replacing the softmax with a kernel function, attention can be rewritten so keys and values fold into a fixed-size running state, making cost linear in sequence length.
- Core ML
Sliding Window Attention
Each token only attends to the nearest W tokens around it instead of every token in the sequence, so attention cost scales linearly with sequence length rather than quadratically.
Optimization
- Core ML
Gradient Descent
Work out which way the loss falls, step a little that way, repeat. That single loop trains almost everything, and the step size decides whether it works.
- Core ML
Stochastic Gradient Descent
Update the model after each example instead of after the whole dataset. The noise in those single-example steps shakes training out of flat spots where exact gradients stall.
- Core ML
Momentum
Plain descent zig-zags across a narrow valley. Average the last few gradients instead, so sideways pushes cancel and the downhill push keeps stacking up.
- Core ML
Adam and AdamW
Adam keeps two running averages of the gradient, so each parameter gets its own step size. AdamW applies weight decay after that scaling, which is why it became the default.
- Core ML
Adaptive Optimizers
One learning rate fails when layers see very different gradient sizes. Adaptive methods give each parameter its own step size from its own recent gradients.
- Core ML
Learning Rate Scheduling
Instead of one fixed learning rate for the whole run, shrink it on a schedule so early steps move fast and later steps settle in carefully.
- Core ML
Learning Rate Warmup
Ramp the learning rate up from near zero over the first few hundred steps, because the earliest updates run on the least trustworthy gradient estimates.
- Core ML
Batch Size Effects
How many examples you average into one update sets how noisy that update is. Small batches wobble more but take more steps per pass, while big batches are steadier yet each doubling buys less.
- Core ML
Mixed Precision Training
Run the fast math in 16-bit while every real weight change lands in a 32-bit master copy. Small gradients survive because loss scaling lifts them into range first.
- Core ML
Gradient Accumulation
Run several small forward-backward passes and sum their gradients before one optimizer step, so limited GPU memory can still train as if it saw one large batch.
Convolutional
- Core ML
Residual Connections
Let each block learn only the correction while the input passes straight through. The identity path is what made 152 layer networks trainable.
- Core ML
Convolution Operation
One small grid of weights slides over the image and takes one dot product at each stop, reusing the same nine numbers everywhere.
- Core ML
Convolutional Neural Networks
Small shared kernels scan the whole image for local patterns, pooling shrinks those maps while growing depth, and a classifier votes one label from what is left.
- Core ML
CNN Architectures
Each famous CNN fixed one specific limit of the last, from LeNet proving the shape to ResNet making 152 layers trainable.
- Core ML
Pooling Layers
Shrink a feature map by keeping only the strongest signal in each small patch, trading exact position for tolerance to roughly where a pattern sat.
- Core ML
Receptive Fields
Each unit only ever looks at a small patch directly, but stacking layers lets that patch grow until a deep unit has effectively seen the whole image.
- Core ML
Depthwise Separable Convolutions
Split one expensive convolution into a cheap per-channel pass and a cheap channel-mixing pass, cutting the weight count by nearly an order of magnitude.
Representation Learning
- Core ML
Transfer Learning
A pretrained model already knows edges, textures and syntax. So freeze all of that, train a new head, and unfreeze deeper only when your labels support it.
- Core ML
Self-Supervised Learning
Hide part of your own data and train the model to predict what you hid. The answer was already there, so you get supervision nobody had to pay for.
- Core ML
Contrastive Learning
Two crops of one photo should land close together, crops of other photos far apart. Whatever you augment away is exactly what the model learns to ignore.
- Core ML
Multi-Task Learning
Train one shared network on several related tasks at once, so each task's gradient shapes the same trunk and the shared layers help every head, not just one.
- Core ML
Domain Adaptation
A model trained on one data distribution gets deployed on a shifted one, and domain adaptation closes that gap without collecting new labels.
- Core ML
Graph Neural Networks
Each node collects information from its neighbors, combines it with its own, and repeats, so a network can learn from relationships, not just isolated rows.
- Core ML
Graph Representation Learning
A graph is links, but models want rows of numbers. This page turns each node into a short vector so linked nodes land near each other and plain models can use them.
Label Efficiency
- Core ML
Semi-Supervised Learning
Train on a handful of labelled examples, let that model guess labels for the rest, and keep only the guesses it is confident about. Confidence is the whole method.
- Core ML
Few-Shot Learning
Classify a new category correctly after seeing only a handful of labeled examples of it. A strong embedding does the hard work, so three examples can be enough.
Generative
- Core ML
Autoencoders
Force data through a layer too narrow to hold it, then ask for the original back. Whatever survives the squeeze is the structure the data actually has.
- Core ML
Variational Autoencoders
A plain autoencoder's latent space has holes, so sampling it gives nothing. Make the encoder emit a distribution instead of a point and the gaps fill in.
- Core ML
Generative Adversarial Networks
Skip writing a loss for realism. Train a critic to spot fakes and train the maker to fool it, so the game is the loss.
Recurrent
- Core ML
Attention Mechanism
Instead of reading one fixed summary vector, let the decoder look back at every encoder state and weigh each one by how relevant it is to the current step.
- Core ML
Long Short-Term Memory
Give the network a separate memory line that gates control instead of overwrite, so relevant information from many steps back can survive untouched until it's needed.
- Core ML
Gated Recurrent Unit
A recurrent cell that keeps old memory unless new input earns a rewrite. Two small gates decide what to forget when building a candidate and how much of it to keep.
- Core ML
Vanilla RNN
Reuse the same small network at every time step, and let a hidden state carry forward whatever happened earlier so order in the sequence actually matters.
- Core ML
Bidirectional RNNs
Run one chain forward and a second chain backward over the same sequence, then join both states at each position so every token sees what came before and after.
- Core ML
Sequence-to-Sequence
An encoder squeezes an input sequence into one fixed-size vector, and a decoder generates an output sequence from that vector alone. Lengths in and out never have to match.
Classical Nlp Representations
- Core ML
Word2Vec
Word2Vec turns each word into a short list of numbers, learned by guessing neighbours, so words that share company land near each other.
- Core ML
GloVe
Count how often every word meets every other word across the whole corpus, then squeeze that giant table into short vectors that keep the ratios.
- Core ML
Bag of Words
Each sentence becomes a tally of its words over one shared list, so sentences with similar tallies likely share a topic.
- Core ML
TF-IDF
Common words shout the loudest in raw counts. TF-IDF turns down words that appear everywhere and turns up words that are frequent here but rare elsewhere.
- Core ML
Text Preprocessing
Models count numbers, not words. Preprocessing turns a messy sentence into clean base-form tokens, so Cat, cat and cats all count as one word.
Classical Nlp Embeddings And Tasks
- Core ML
FastText
FastText spells each word from overlapping letter chunks, so jump and jumping share most of their parts and a typo still looks familiar.
- Core ML
Sentence Embeddings
One dense vector per whole sentence, trained so that paraphrases land close together and unrelated sentences land far apart. Meaning you can compare with a ruler.
- Core ML
Text Classification
Take raw text, turn it into numbers, and pick one label from a fixed list. Spam filters, sentiment meters, and ticket routers are all the same pipeline.
- Core ML
Named Entity Recognition
Scan raw text word by word, label each token, and group the labels into people, places, organizations, and dates that a database can store.
Classical Nlp Close Out
- Core ML
Machine Translation
Translate a whole sentence by reading its full meaning first, then writing it fresh in the target language. Word order and idioms stop being blockers once the model carries meaning instead of single words.
- Core ML
Text Summarization
A summary keeps the facts and drops the filler. Some systems copy the best sentences word for word while others write new ones, and each choice fails in its own way.
- Core ML
Topic Modeling
Documents that share words share themes, so counting which words travel together reveals the hidden topics.
Architecture
Compression
- Core ML
Knowledge Distillation
Train a tiny model to copy a big trained model's full probability spread across every class, not just its top pick. The runner-up scores teach distinctions the hard labels never recorded.
- Core ML
Model Pruning
Most trained weights sit near zero and contribute almost nothing. Pruning zeroes exactly those, leaving a sparse network that acts the same but fits smaller chips.
- Core ML
Quantization-Aware Training
Round weights to low precision during training itself, not after, so gradients push the network toward values that survive rounding instead of being surprised by it on the device.
Recommender Systems Architecture
- Core ML
Collaborative Filtering
You get picks from people whose past ratings match yours, not from item descriptions. Overlap in behavior decides the next recommendation.
- Core ML
Recommender System Architecture
A multi-stage funnel that takes a catalog of millions of items and filters it down to the ten picks one user sees, cheap and fast first, careful and slow last.
Recommender Systems Ranking
- Core ML
Learning to Rank (LTR)
Instead of predicting an absolute score like 4.2 stars, train the model on relative order, learning that item A belongs above item B.
- Core ML
Two-Tower Retrieval
Encode the user with one network and the item with another, then score with a dot product. The split lets you precompute item vectors and search millions in milliseconds.
- Core ML
The Cold Start Problem
A recommender that learns only from past clicks has nothing to say about a brand-new user or item, so it falls back to popularity lists until clicks arrive.
Recommender Systems Evaluation
- Core ML
Recommendation Evaluation
Standard metrics like accuracy do not care where the right answer sits in a list. Ranking metrics do, and diversity checks stop the list going stale.
- Core ML
Contextual Bandits
A contextual bandit picks a different winner for each situation and learns from the payoff, so morning phone shoppers and evening laptop shoppers stop seeing the same list.
Reinforcement Learning
- Core ML
Reinforcement Learning Foundations
There is no answer key, just a number that lands after you act. The framework is a Markov decision process, and the reward never names a correct action.
- Core ML
Q-Learning and DQN
Learn what each action is finally worth, then take the biggest number. Two tricks made that work with a network: sampled replay, and a target that holds still.
- Core ML
Policy Gradient Methods
Push up the probability of actions that paid off. The estimate is unbiased and wildly noisy, so every refinement after REINFORCE is about shrinking variance.
- Core ML
Proximal Policy Optimization
Reuse one batch of rollouts for several updates, but clip the objective so no step can drag the policy far from the data it learned on.
Time Series Foundations
- Core ML
ARIMA
ARIMA forecasts tomorrow by repeating a slice of recent movement and correcting for recent mistakes, after flattening any trend first.
- Core ML
Exponential Smoothing
Predict tomorrow by averaging the past with weights that fall by half at each step back, so yesterday shapes the forecast far more than last month.
- Core ML
Stationarity
The property of a time series whose statistical properties (like mean and variance) do not change over time. A strict requirement for almost all classical forecasting algorithms.
- Core ML
Autocorrelation
Today usually looks like yesterday, and some days repeat on a weekly rhythm. Autocorrelation turns both hunches into one number per lag.
- Core ML
Time Series Decomposition
A sales curve is trend plus repeating season plus noise, and each part is easier to forecast than the messy whole.
Time Series Evaluation
- Core ML
Backtesting (Time Series)
Backtesting replays the past the way it actually unfolded: train only on what came before, predict what came next, and average the misses.
- Core ML
Forecast Evaluation
A forecast is only as good as the ruler used to grade it. Different error metrics punish the same miss in very different ways.
Time Series Modelling
Causal Inference And Experimentation
- Core ML
Causal Graphs
A causal graph draws arrows for what causes what, so you know which variables to adjust for and which to leave alone to get the true effect.
- Core ML
Correlation vs Causation
When two things move together, one might cause the other, or a hidden third factor might be driving both. ML optimizes correlation; intervention requires causation.
- Core ML
Randomized Experiments
When you flip a coin to decide who gets a treatment, you guarantee that nothing else caused the decision. Randomization severs the link from all confounders, known and unknown.
- Core ML
A/B Testing for ML
Split your users at random, give half the old model and half the new one, then compare what each group actually does. If the new group buys more, the model caused it.
- Core ML
Confounding and Colliders
A confounder feeds both treatment and outcome, so you must adjust for it. A collider is fed by both, so adjusting for it creates bias.
- Core ML
Potential Outcomes
Every choice splits into two futures, treated and not, but you only ever see one side of the split.
- Core ML
Propensity Score Methods
When a trial is impossible, squeeze age, income, and history into one number, then compare treated and control users who share it.
Security
- Core ML
Differential Privacy
Differential privacy adds a calculated amount of mathematical noise during training, so the finished model looks essentially the same whether any one person's data was included or not.
- Core ML
Adversarial Examples: Tiny Noise, Wrong Answer
A shift too small to see can still flip a network's answer. An adversarial example is an input nudged along the model's own gradients until it lands on the wrong side of the boundary.
- Core ML
Adversarial Training
Train on your worst-case inputs, not just the clean ones, so a tiny hostile nudge can't flip your model's answer.