🐍 Python

Python programming, data science, AI/ML, and automation

32 posts in this category

All Python Posts

Scikit-Learn (Part 17)
Scikit-Learn (Part 17)
Neil Haddley • October 13, 2026

Autoencoders, GANs, and diffusion models: networks that squeeze data and rebuild it, and networks that invent new clothing pictures

AIPython
machine-learningautoencodergan
Scikit-Learn (Part 16)
Scikit-Learn (Part 16)
Neil Haddley • October 13, 2026

Natural language processing with recurrent networks and attention: a Shakespeare character model, movie review sentiment, translation, the Transformer, and pretrained models from Hugging Face

AIPython
machine-learningnlpattention
Scikit-Learn (Part 15)
Scikit-Learn (Part 15)
Neil Haddley • October 13, 2026

Processing sequences with recurrent neural networks (RNNs) and CNNs: forecasting daily train ridership, comparing a naive guess, a statistical model, and RNNs, and forecasting several days ahead

AIPython
machine-learningrnntime-series
Scikit-Learn (Part 14)
Scikit-Learn (Part 14)
Neil Haddley • October 13, 2026

Deep computer vision with convolutional neural networks (CNNs): filters that slide across an image, pooling, a CNN for clothing, a pretrained ResNet, and transfer learning for flowers

AIPython
machine-learningcnncomputer-vision
Scikit-Learn (Part 13)
Scikit-Learn (Part 13)
Neil Haddley • October 13, 2026

Loading and preprocessing data with TensorFlow: a tf.data pipeline that reads many files, shuffles, and batches, the TFRecord format, and Keras layers that turn raw values into numbers

AIPython
machine-learningtensorflowtf-data
Scikit-Learn (Part 12)
Scikit-Learn (Part 12)
Neil Haddley • October 13, 2026

Custom models and training with TensorFlow: tensors, automatic slopes with GradientTape, and a training loop written by hand instead of calling fit()

AIPython
machine-learningtensorflowkeras
Scikit-Learn (Part 11)
Scikit-Learn (Part 11)
Neil Haddley • October 13, 2026

Training deep neural networks: why deep networks are hard to train, and the starting numbers, activation functions, batch normalization, optimizers, and dropout that make it work

AIPython
machine-learningneural-networkskeras
Scikit-Learn (Part 10)
Scikit-Learn (Part 10)
Neil Haddley • October 12, 2026

Neural networks with Keras: a network of 266,610 numbers that learns to recognise clothing, trained by backpropagation, the way large language models are

AIPython
machine-learningneural-networkskeras
Scikit-Learn (Part 9)
Scikit-Learn (Part 9)
Neil Haddley • October 12, 2026

Unsupervised learning: finding groups in data that has no labels, with K-Means, DBSCAN, and Gaussian mixtures, and getting far with only 50 labels

AIPython
machine-learningscikit-learnclustering
Scikit-Learn (Part 8)
Scikit-Learn (Part 8)
Neil Haddley • October 12, 2026

Dimensionality reduction: squeezing 784 pixels into far fewer numbers with PCA, random projection, and manifold learning, while keeping what matters

AIPython
machine-learningscikit-learnpca
Scikit-Learn (Part 7)
Scikit-Learn (Part 7)
Neil Haddley • October 12, 2026

Ensemble learning and random forests: many models voting, bagging, boosting, and stacking, and how much better a crowd of models does than any one of them

AIPython
machine-learningscikit-learnensemble-learning
Scikit-Learn (Part 6)
Scikit-Learn (Part 6)
Neil Haddley • October 12, 2026

Decision trees: a model that asks one question at a time, grown split by split, and why it needs holding back

AIPython
machine-learningscikit-learndecision-trees
Scikit-Learn (Part 5)
Scikit-Learn (Part 5)
Neil Haddley • October 12, 2026

Support vector machines: the widest street between two classes, kernels for curved boundaries, and an SVM trained both directly and by gradient descent

AIPython
machine-learningscikit-learnsupport-vector-machines
Scikit-Learn (Part 4)
Scikit-Learn (Part 4)
Neil Haddley • October 12, 2026

Training linear models: the same line worked out directly and found by gradient descent, then curves, regularization, and logistic regression

AIPython
machine-learningscikit-learngradient-descent
Scikit-Learn (Part 3)
Scikit-Learn (Part 3)
Neil Haddley • October 12, 2026

Classification: recognising handwritten digits, and why accuracy alone can mislead, with confusion matrices, precision, and recall

AIPython
machine-learningscikit-learnclassification
Scikit-Learn (Part 2)
Scikit-Learn (Part 2)
Neil Haddley • October 12, 2026

An end-to-end machine learning project: predicting California house prices, from raw data to a tested model

AIPython
machine-learningscikit-learncalifornia-housing
Scikit-Learn (Part 1)
Scikit-Learn (Part 1)
Neil Haddley • October 12, 2026

Machine Learning with Python

AIPython
machine-learningscikit-learnregression
MiniGPT, grown in code you can read
MiniGPT, grown in code you can read
Neil Haddley • October 11, 2026

An experiment: the code that trains MiniGPT from random numbers, rewritten for people, treating the whole readable model as a black box, with the surprise score and the AdamW nudge written out, and a check against the original

AIPython
gpttransformerspytorch
MiniGPT, rewritten to be read
MiniGPT, rewritten to be read
Neil Haddley • October 9, 2026

An experiment: the code that runs my trained MiniGPT model, rewritten for people, with a name for every value, every shape written down, every library call explained, and honest notes where nobody knows why it works

AIPython
gpttransformerspytorch
Voice Kit (Part 4)
Voice Kit (Part 4)
Neil Haddley • December 14, 2025

Automatically Boot your Raspberry Pi 3 into Google Voice Assistant

PythonAIIOT
raspberry-pigoogle-assistantautostart
Voice Kit (Part 3)
Voice Kit (Part 3)
Neil Haddley • October 18, 2025

Adding Commands

PythonAIIOT
raspberry-pigoogle-assistantvoice-commands
Voice Kit (Part 2)
Voice Kit (Part 2)
Neil Haddley • October 16, 2025

Google Assistant API

PythonAIIOT
raspberry-pigoogle-assistant-apivoice
Voice Kit (Part 1)
Voice Kit (Part 1)
Neil Haddley • October 11, 2025

Raspberry Pi Voice Kit

PythonAIIOT
raspberry-pivoice-assistantgoogle-assistant
LangChain Agents
LangChain Agents
Neil Haddley • August 25, 2024

Building LangChain agents that use LLMs as a reasoning engine to choose which tools to call, execute them, and loop until the task is complete

AIPython
langchainagentsllm
Gingerbread House
Gingerbread House
Neil Haddley • December 26, 2023

holiday.py

PythonIOT
raspberry-piholidaygpio
Colorization
Colorization
Neil Haddley • August 3, 2023

colorization.ipynb

PythonAI
colorizationjupyter-notebookimage-processing
Apple MacBook
Apple MacBook
Neil Haddley • July 25, 2023

Setting up Anaconda on a MacBook for data science and machine learning — installs Python, the Conda package manager, and Jupyter Notebook

PythonmacOS
anacondapython-environmentsetup
LangChain (RAG)
LangChain (RAG)
Neil Haddley • July 21, 2023

Using LangChain to create a medical report application

AIPython
langchainragretrieval-augmented-generation
Machine Learning (Part 4)
Machine Learning (Part 4)
Neil Haddley • June 8, 2022

Using Google Colab (Jupyter Notebooks in the cloud) to run machine learning experiments with GPU access and no local setup required

AIPython
machine-learninggoogle-colabjupyter-notebook