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.

A4100 ChaptersBI · ENPython1,894 pages
Profitina AI Programming Tutorial: From Zero to Building 100 Applications with Python
Download Full Book (PDF) Download the Source Code (ZIP)

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

  1. Your Workbench and a Number-Guessing AI
  2. A Smart Expense Categorizer for Bank and E-Wallet Statements
  3. A Warehouse Picking-Route Optimizer: BFS, DFS and A*
  4. A Meal Planner on a Budget and a Nutrition Target
  5. A Timetable Scheduler for a School or a Clinic: Constraint Satisfaction
  6. A Customer-Service Chatbot for a Small Business: Intents, Rules and a Human in the Loop
  7. A Rule-Based Expert System: The Laundry-Stain Advisor
  8. A Route Planner for Surabaya: Dijkstra and A* on a City Graph
  9. A Genetic Algorithm Scheduler
  10. A Fuzzy-Logic Controller for a Fan
  11. House-Price Predictor: Linear Regression from Scratch and with scikit-learn
  12. Spam Filter: Logistic Regression
  13. Iris Flower Classifier: k-Nearest Neighbors
  14. Loan Approval Advisor: An Explainable Decision Tree
  15. Sentiment Analyzer: Naive Bayes in Indonesian and English
  16. Customer Segmentation: k-Means on Laundry Data
  17. Data Explorer with Principal Component Analysis
  18. Handwritten Digit Recognizer: Support Vector Machines
  19. Churn Predictor: Random Forests and Gradient Boosting
  20. Model Evaluation Dashboard: Metrics, ROC and Cross-Validation
  21. Tokenizer and Word Counter
  22. Spell Checker
  23. Keyword Extractor (TF-IDF)
  24. Extractive Summarizer
  25. News Topic Classifier
  26. Language Detector
  27. Smart-Reply Suggestions for Business Chats
  28. Named-Entity Finder
  29. FAQ Answer Bot (BM25)
  30. Plagiarism Checker
  31. Perceptron from Scratch
  32. Multilayer Network in NumPy
  33. Digit Recognizer in PyTorch
  34. Autoencoder That Compresses and Denoises
  35. Convolutional Network for Images
  36. Next-Word Prediction for a Phone Keyboard
  37. Word Embeddings Trained from Scratch
  38. Attention, Visualized
  39. A Tiny Transformer Language Model
  40. Privacy-Preserving Synthetic Data with a GAN
  41. Image Filters (Convolution by Hand)
  42. Edge and Corner Detector
  43. Color Palette Extractor (k-means)
  44. Product-Defect Inspection on a Production Line
  45. Simple OCR for Printed Digits
  46. Object Counter (Connected Components)
  47. Image Similarity Search (Embeddings)
  48. Background Remover (Thresholding, GrabCut-Free)
  49. Data Augmentation Lab
  50. Transfer Learning with a Small CNN (Offline)
  51. A Film Recommender That Reads the Catalog (Content-Based Filtering)
  52. People Like You Also Enjoyed: Collaborative Filtering
  53. Hidden Tastes: A Matrix Factorization Recommender
  54. Searching by Meaning: A Semantic Search Engine for a Help Center
  55. Product Search with Ranking: Retrieval, Features and Learning to Rank
  56. Customers Also Bought: Association Rules with Apriori
  57. A Music Playlist Generator: Similarity, Smooth Transitions and an Energy Arc
  58. Personalizing a News Page with Bandits
  59. Have We Answered This Before? A Duplicate-Question Detector
  60. Autocomplete: A Trie, a Language Model and a Search Box That Finishes Your Sentence
  61. Sales Forecaster: Moving Averages and Exponential Smoothing
  62. Laundry Demand Forecaster: Seasonality and Holidays
  63. ARIMA from First Principles
  64. Anomaly Detector for Transactions: z-Scores and Isolation Forests
  65. Sensor Fault Detector
  66. Energy-Use Predictor
  67. Queue-Time Estimator
  68. Price Simulator: Monte Carlo
  69. Event Detector in a Stream
  70. Forecast Evaluation and Backtesting
  71. An A/B Tester That Learns While It Tests (Multi-Armed Bandits)
  72. A Robot That Learns Its Way Across the Laundry Room (Q-Learning in a Grid World)
  73. Balancing a Pole on a Cart (CartPole with a Policy Gradient)
  74. An Energy-Saving Air-Conditioner Agent
  75. Dynamic Pricing for a Small Shop, with Guardrails
  76. An Inventory Reorder Agent for Laundry Supplies
  77. A Delivery-Route Agent (Traveling Salesman Heuristics)
  78. A Trading-Bot Simulator (Paper Trading, Backtests and the Trap of Luck)
  79. A Multi-Agent Traffic Simulation (Cellular Automata and Adaptive Signals)
  80. A Planning Agent (STRIPS, Heuristic Search and Replanning)
  81. Talking to a Local LLM
  82. Chat App with Memory
  83. Prompt Engineering Lab
  84. Retrieval-Augmented Generation over Your Notes
  85. Document Summarizer and Translator
  86. Structured Output and JSON Extraction
  87. Tool-Using Agent
  88. Code Explainer and Reviewer
  89. LLM Evaluation Harness
  90. Guardrails and Safety Filters
  91. Serving a Model with FastAPI
  92. A Web Front End for Your AI (Flask + HTML)
  93. A Streamlit Dashboard
  94. A Gradio Demo App
  95. Command-Line AI Tool and Packaging (pyproject)
  96. Testing ML Code
  97. Experiment Tracking and Reproducibility
  98. Model Monitoring and Drift Detection
  99. Privacy, Fairness and Responsible AI in Practice (UU PDP)
  100. Capstone: An AI Assistant for Profitina Laundry
Who this book is for: Anyone who wants to build useful software with AI, starting from nothing. You do not need to know how to program: Chapter 1 begins with an empty computer, installs VS Code and Python on Windows, macOS or Linux, and ends with your first AI program running. From there every idea is explained in plain words first, then shown in code, then run, then explained line by line. If you can follow a recipe, you can follow this book.

Profitina · profitina.com

💬 Community Discussion