Book
AI Programming Tutorial: From Zero to Building 100 Applications with Python
From Zero to Building 100 Applications — A shopkeeper photographs a receipt and her phone files it under “stock”. A clinic’s schedule fills itself without two doctors in the same room.
Overview
The hundred chapters are grouped in ten parts of ten: classic AI that thinks by searching and reasoning; learning from data; language; neural networks; vision; recommenders and search; time series and anomalies; agents and reinforcement learning; local language models and generative apps; and turning a notebook into a product. Each chapter opens with the real-life use of its application, builds it step by step, runs it on real or realistic data, improves it, and ends with how to use it for real on your own data, common mistakes, a summary, and exercises with complete solutions.
Everything runs offline on an ordinary laptop. The data the programs use ships with them, and the language-model chapters work with a local model through Ollama — no paid service and no data leaving your computer. Every program was run before its output was printed; the code is collected chapter by chapter in the accompanying Code folder, with a README in every chapter folder that explains how to run it in a terminal and in VS Code on Windows, macOS and Linux.
Inside the Book
- Your Workbench and a Number-Guessing AI
- A Smart Expense Categorizer for Bank and E-Wallet Statements
- A Warehouse Picking-Route Optimizer: BFS, DFS and A*
- A Meal Planner on a Budget and a Nutrition Target
- A Timetable Scheduler for a School or a Clinic: Constraint Satisfaction
- A Customer-Service Chatbot for a Small Business: Intents, Rules and a Human in the Loop
- A Rule-Based Expert System: The Laundry-Stain Advisor
- A Route Planner for Surabaya: Dijkstra and A* on a City Graph
- A Genetic Algorithm Scheduler
- A Fuzzy-Logic Controller for a Fan
- House-Price Predictor: Linear Regression from Scratch and with scikit-learn
- Spam Filter: Logistic Regression
- Iris Flower Classifier: k-Nearest Neighbors
- Loan Approval Advisor: An Explainable Decision Tree
- Sentiment Analyzer: Naive Bayes in Indonesian and English
- Customer Segmentation: k-Means on Laundry Data
- Data Explorer with Principal Component Analysis
- Handwritten Digit Recognizer: Support Vector Machines
- Churn Predictor: Random Forests and Gradient Boosting
- Model Evaluation Dashboard: Metrics, ROC and Cross-Validation
- Tokenizer and Word Counter
- Spell Checker
- Keyword Extractor (TF-IDF)
- Extractive Summarizer
- News Topic Classifier
- Language Detector
- Smart-Reply Suggestions for Business Chats
- Named-Entity Finder
- FAQ Answer Bot (BM25)
- Plagiarism Checker
- Perceptron from Scratch
- Multilayer Network in NumPy
- Digit Recognizer in PyTorch
- Autoencoder That Compresses and Denoises
- Convolutional Network for Images
- Next-Word Prediction for a Phone Keyboard
- Word Embeddings Trained from Scratch
- Attention, Visualized
- A Tiny Transformer Language Model
- Privacy-Preserving Synthetic Data with a GAN
- Image Filters (Convolution by Hand)
- Edge and Corner Detector
- Color Palette Extractor (k-means)
- Product-Defect Inspection on a Production Line
- Simple OCR for Printed Digits
- Object Counter (Connected Components)
- Image Similarity Search (Embeddings)
- Background Remover (Thresholding, GrabCut-Free)
- Data Augmentation Lab
- Transfer Learning with a Small CNN (Offline)
- A Film Recommender That Reads the Catalog (Content-Based Filtering)
- People Like You Also Enjoyed: Collaborative Filtering
- Hidden Tastes: A Matrix Factorization Recommender
- Searching by Meaning: A Semantic Search Engine for a Help Center
- Product Search with Ranking: Retrieval, Features and Learning to Rank
- Customers Also Bought: Association Rules with Apriori
- A Music Playlist Generator: Similarity, Smooth Transitions and an Energy Arc
- Personalizing a News Page with Bandits
- Have We Answered This Before? A Duplicate-Question Detector
- Autocomplete: A Trie, a Language Model and a Search Box That Finishes Your Sentence
- Sales Forecaster: Moving Averages and Exponential Smoothing
- Laundry Demand Forecaster: Seasonality and Holidays
- ARIMA from First Principles
- Anomaly Detector for Transactions: z-Scores and Isolation Forests
- Sensor Fault Detector
- Energy-Use Predictor
- Queue-Time Estimator
- Price Simulator: Monte Carlo
- Event Detector in a Stream
- Forecast Evaluation and Backtesting
- An A/B Tester That Learns While It Tests (Multi-Armed Bandits)
- A Robot That Learns Its Way Across the Laundry Room (Q-Learning in a Grid World)
- Balancing a Pole on a Cart (CartPole with a Policy Gradient)
- An Energy-Saving Air-Conditioner Agent
- Dynamic Pricing for a Small Shop, with Guardrails
- An Inventory Reorder Agent for Laundry Supplies
- A Delivery-Route Agent (Traveling Salesman Heuristics)
- A Trading-Bot Simulator (Paper Trading, Backtests and the Trap of Luck)
- A Multi-Agent Traffic Simulation (Cellular Automata and Adaptive Signals)
- A Planning Agent (STRIPS, Heuristic Search and Replanning)
- Talking to a Local LLM
- Chat App with Memory
- Prompt Engineering Lab
- Retrieval-Augmented Generation over Your Notes
- Document Summarizer and Translator
- Structured Output and JSON Extraction
- Tool-Using Agent
- Code Explainer and Reviewer
- LLM Evaluation Harness
- Guardrails and Safety Filters
- Serving a Model with FastAPI
- A Web Front End for Your AI (Flask + HTML)
- A Streamlit Dashboard
- A Gradio Demo App
- Command-Line AI Tool and Packaging (pyproject)
- Testing ML Code
- Experiment Tracking and Reproducibility
- Model Monitoring and Drift Detection
- Privacy, Fairness and Responsible AI in Practice (UU PDP)
- Capstone: An AI Assistant for Profitina Laundry
Profitina · profitina.com

