AI By Doing: A Hands-on Guide to Artificial Intelligence#
Preface#
I began my journey into machine learning in 2015, starting with Professor Li Hang’s “Statistical Learning Methods.” As I progressed through various learning materials, I noticed some common challenges in the field.
For instance, many textbooks written by university professors tend to be heavily theoretical and require advanced mathematical knowledge, making them difficult for beginners to grasp. They often lack practical code implementations. On the other hand, books written by engineers typically focus on practical applications, merely introducing tools and libraries without delving into the underlying principles. Additionally, many resources provide code examples alongside algorithmic concepts, but these examples are often incomplete or disconnected from the theory, making it difficult for readers to replicate the results.
When starting with machine learning, simply knowing how to use libraries without understanding the principles can be limiting - you might not even understand parameter settings, let alone know how to tune them. Conversely, if you only know the theory without practical experience, you might struggle to implement even the simplest models. My goal is to help you both understand the principles and apply them in practice, giving you a comprehensive grasp of machine learning.
Since 2018, I’ve been creating content using Jupyter Notebook, which allows for seamless integration of text and code, making it easier to read and understand. It also displays code alongside its output, facilitating practice and replication.
This hands-on AI tutorial series aims to introduce you to machine learning and deep learning, starting with supervised learning. I break down and derive the principles behind each fundamental algorithm, showing the mathematical processes while implementing them in Python code, ensuring a clear correspondence between formulas and implementation. I also demonstrate how to achieve the same results using mainstream frameworks, helping readers understand the differences between manual implementation and framework-based approaches.
This content assumes you have basic Python programming skills and undergraduate-level mathematics knowledge in calculus, linear algebra, and probability theory. Don’t worry if you’re rusty - we’ll help you refresh these concepts as needed. I’ve included “Appendix I: Mathematical Foundations for Machine Learning” and “Appendix II: Common Tools in Machine Learning” for reference. These are in the appendix because I don’t recommend studying them first, as this might consume too much time and diminish your enthusiasm. Instead, refer to them as needed during your learning journey.
The best way to learn from this course is to practice hands-on with your computer. I recommend using Jupyter Notebook to document your code exercises and understanding, creating your own study notes. Simply reading through the material is unlikely to be effective.
Currently, this work comprises 97 chapters (24,150 words) and is continuously updated. In this era of AI-generated content, I hope this human-crafted material helps you better understand machine learning.
I recommend learning basic Linux skills through LabEx in your spare time, as this will greatly help with the practical aspects of this tutorial.
Membership#
If you find this tutorial helpful, consider supporting the Pro membership plan. This is entirely optional - all content remains free to read and learn from.
Additionally, I’m an indie iOS developer. Feel free to check out and support my Apps on the App Store.
License#
This work is created by huhuhang and is registered and notarized for copyright protection.
This site is licensed under the Attribution-NonCommercial-NoDerivatives 4.0 International license.
Additional rules include:
-
🚫 Do not clone the entire site to create similar websites
-
🚫 Do not compile site content into e-books for distribution
-
🚫 Please don’t “open source” the site content on my behalf
-
🚫 Do not use the content for commercial purposes (for commercial licensing, contact
huhuhang@gmail.com
)
The articles contain numerous formulas, code examples, and custom styles. I created this site to provide the best possible learning experience. Rather than copying or reposting content, please share the original link so readers can access the latest version and enjoy the optimal reading experience.
Table of Contents#
Supervised Learning (Regression)#
Supervised Learning (Classification)#
Unsupervised Learning (Clustering)#
Unsupervised Learning (Association Rules)#
Machine Learning Engineering (Model Deployment and Inference)#
Deep Learning Principles (Artificial Neural Networks)#
Deep Learning Frameworks (TensorFlow & PyTorch)#
Deep Learning Applications (Computer Vision)#
Deep Learning Applications (Natural Language Processing)#
Deep Learning Engineering (Model Deployment and Inference)#
Reinforcement Learning Fundamentals#
Appendix (Machine Learning Mathematical Foundations)#
Appendix (Machine Learning Common Tools)#
Discussion#
If you have any questions about the material, feel free to leave a comment at the bottom of each page. I’ll respond when possible, and you’re welcome to help answer others’ questions too.
No content is perfect - if you spot any errors, typos, or code issues, please point them out in the comments. I’ll verify and correct them as soon as possible.
Acknowledgments#
Listed chronologically:
-
Thanks to Cloudflare for providing free hosting and CDN services
-
Thanks to whyiug for corrections to the “Autograd” section description and example code
-
Thanks to Ruan Yifeng’s Tech Enthusiast Weekly (Issue 295) for the recommendation
-
Thanks to Howie’s Weekly (Issue 135) for the recommendation
-
Thanks to Ou opacity for the recommendation
-
Thanks to 不求甚解 channel for the recommendation
If you’ve recommended this site, please let me know through comments or email, and I’ll add a Do Follow link to acknowledge your support.
Contributing#
If you’d like to help improve the content or fix errors, please start by creating an issue on GitHub indicating your interest in contributing. Once confirmed, I’ll invite you to join the content collaboration repository.