1.6 Implementing a Perceptron in Python. Parts 1-3
What we covered in this video lecture
In this video, we implemented our first machine learning algorithm — a perceptron classifier — in Python. Along the way, we used pandas to load the data from a text file, NumPy to check the class label distribution, and matplotlib to visualize the results.
Additional resources if you want to learn more
If you need help setting up your computing environment, we recommend checking out the previous lecture (1.5 Setting Up Our Computing Environment).
We implemented the Perceptron using an objected-oriented programming paradigm and Python classes. While it is possible to implement a Perceptron using a purely functional approach, the goal was to set the stage for the later units where we will implement deep neural networks. Most deep learning frameworks, including PyTorch, also use a similar paradigm. If you are new to object-oriented programming or Python classes,
If you need help getting started with NumPy and matplotlib, check out Sebastian’s comprehensive tutorial blog and video series: Scientific Computing in Python: Introduction to NumPy and Matplotlib.
Log in or create a free Lightning.ai account to access:
- Completion badges
- Progress tracking
- Additional downloadable content
- Additional AI education resources
- Notifications when new units are released
- Free cloud computing credits