AI and Machine Learning overview
91 topics in 14 lessons, each in one line. Every topic opens the page that teaches it.
After this course you can
- Frame a business problem as a machine learning task, prepare its data, and judge the model with the right metric.
- Explain how a neural network and a large language model work, from tokens and attention to temperature.
- Design an AI application with prompts, RAG, tools and agents, choose between prompting, RAG and fine-tuning, and run it safely.
1What AI and machine learning are
- AI, ML, deep learningEach term names a smaller field inside the one before
- Supervised learningLabelled examples teach the model which answer to give
- Unsupervised learningWith no labels, the model finds the structure itself
- Reinforcement learningAn agent learns from the rewards its actions earn
- AI workloadsMost AI products do one of six jobs, sold ready-made
- When not to use MLUse it only when the rules can’t be written and data exists
2A first model: linear regression
- The taskEight houses have sold. What will the ninth sell for?
- Model parametersA model is a function with knobs; training sets them
- LossLoss turns "how wrong" into one number to push down
- Gradient descentEach step measures the slope and moves the knobs downhill
- Learning rateToo small crawls; too large overshoots and diverges
- Epochs and batchesAn epoch is one pass over all the data, a batch at a time
- Linear regressionA weighted sum of the features predicts a number
3Classification
- Logistic regressionA squashed weighted sum becomes a probability
- Confusion matrixEvery prediction lands in one of four cells
- AccuracyAccuracy hides the rare class: doing nothing scores higher
- Precision and recallPrecision: were the alarms real? Recall: were the cases caught?
- Decision thresholdMoving the threshold trades precision against recall
4Data and generalisation
- Data cleaningMost of the work is cleaning: gaps, outliers, duplicates
- Feature engineeringEvery input becomes a number on a comparable scale
- Data splitsKeep a test set the model never sees until the end
- OverfittingA model that memorises its data fails on anything new
- HyperparametersSettings chosen before training; tuning searches for the best
- Regression metricsMAE and RMSE measure the miss in the target’s units
- BaselinesA model is only good compared with a simple baseline
5Trees, forests and clustering
- Decision treesA tree asks one question at a time, narrowing the data
- Random forestsMany different trees vote, and their errors cancel
- Gradient boostingEach new tree fixes the errors the earlier ones left
- k-means clusteringk centres move until each sits in the middle of its group
- Choosing an algorithmStart from the task; for tables, try boosted trees first
6Neural networks
- Artificial neuronA neuron weighs its inputs, adds them, and bends the sum
- Activation functionsWithout a bend, any stack of layers is one straight line
- LayersLayers turn raw input into features, step by step
- Forward passOne forward pass turns an input into a prediction, in numbers
- BackpropagationThe error flows backward; each weight gets its share of blame
- Convolutional networksA convolution slides one small filter across the whole image
- GPUs and acceleratorsTraining is matrix maths, which GPUs do in parallel
7From model to production
- ML lifecycleA model is never finished: the lifecycle is a loop
- Problem framingA business goal becomes one prediction you can measure
- Inference optionsServe by who is waiting and how often requests come
- MLOpsMLOps turns training and release into a repeatable pipeline
- Deployment strategiesShift traffic to a new model in steps you can undo
- Model driftAccuracy decays as the world drifts from the training data
8How large language models work
- TokensA model reads and writes tokens, not words
- Next-token predictionAn LLM only ever predicts the next token, again and again
- EmbeddingsEmbeddings place meanings as points, close when similar
- AttentionAttention lets each token draw on every other token
- Context windowThe context window is the model’s entire working memory
- Training stagesPretraining teaches language; post-training teaches behaviour
- Temperature and samplingTemperature sharpens or flattens the odds before sampling
- Diffusion modelsImage models start from noise and remove it step by step
9Prompting
- Prompt anatomyA reliable prompt has a task, context, an example and a format
- System prompt and messagesThe system prompt sets the rules; messages carry the chat
- Few-shot promptingExamples teach the format faster than any description
- Step-by-step reasoningAsking for the steps first improves multi-step answers
- Structured outputWhen code reads the answer, ask for JSON against a schema
- Prompt failuresMost bad answers trace back to the prompt
- Testing promptsVersion prompts like code and test every change
10Retrieval-augmented generation
- Why RAGRAG answers from your documents, not just from training
- The two pipelinesIndex the documents once; retrieve for every question
- ChunkingHow you split documents decides what can be found
- Vector searchVector search finds the chunks closest in meaning
- Hybrid search and rerankingCombine keyword and vector search, then rerank
- Grounding and citationsTell the model to answer only from the sources, and cite them
- Evaluating RAGTest retrieval and generation separately
11Agents and tools
- Tool callingA model calls tools by asking your code to run them
- The agent loopAn agent loops: reason, act, observe, until the goal is met
- Model Context ProtocolMCP lets any AI app use any tool through one standard
- MemoryThe context fills with every step; agents summarise and store
- Workflows and agentsFix the steps when you can; use an agent when you must
- Why long chains failSmall error rates compound over many steps
- Keeping agents safeLeast privilege and a person’s approval for risky actions
12Customising and running models
13Responsible AI and security
- Responsible AI principlesMicrosoft and AWS name the same responsible AI ideas
- Measuring biasMeasure bias by comparing groups in the data and the outcomes
- ExplainabilitySHAP values show why the model decided this case
- HallucinationModels state false things fluently; make it rarer and catch it
- Prompt injectionPrompt injection makes a model obey text it should only read
- GuardrailsGuardrails filter what goes into and comes out of a model
- Governance and regulationRules scale with risk: the EU AI Act and management frameworks
14A support assistant over company documentsWorked case
- The problemJudge an assistant by the answers it should not give
- The estimateCost follows tokens, and most tokens are the articles
- The first designAsked directly, a model answers from training, not from your product
- The causeMeasured on 200 real questions, 42% of answers are wrong
- The fixRetrieval gives the facts; a guardrail and a hand-off stop the rest
- The trade-offEvery step that improves answers adds cost and delay
- The finished designThe model is one box of eleven
- A real caseAt DoorDash, the guardrail and the judge did most of the work
Sources and credit
43 sourcesThe chapters and drawings are written by NeuroqAI from these sources. Each lesson lists its own at the end of its chapter, and figures on the pages are taken from them or computed from them.