Machine Learning Tutorial: Supervised Learning

Andy, a scikit-learn maintainer, explains machine learning's three branches: supervised learning (labeled data), unsupervised learning (finding hidden patterns), and reinforcement learning (learning from rewards). Supervised learning splits into classification for categories and regression for continuous values. He covers how to get labeled data through historical datasets, experiments, or crowdsourcing.
Chapters
Welcome to the course. My name is Andy and I'm a core contributor and co maintainer of scikit. Learn. You're here to learn about the wonderful world of supervised learning, arguably the most important branch of machine learning. But what is machine learning? Machine learning is the art and science of giving computers the ability to learn to make decisions from data without being explicitly programmed. For example, your computer can learn to predict whether an email is spam or not spam, given content and sender. Another example, your computer can learn to cluster, say, Wikipedia entries into different categories based on words they contain. It could then assign any new Wikipedia article to one of the existing clusters. Notice that in the first example, we are trying to predict a particular class label that is spam or not spam. In the second example, there is no such label. When there are labels present, we call it supervised learning. When there are no labels present, we call it unsupervised learning. Unsupervised learning, in essence, is the machine learning task of uncovering hidden patterns and structures from unlabeled data. For example, a business may wish to group its customers into distinct categories based on their purchasing behavior without knowing in advance what these categories might be. This is known as clustering, one branch of unsupervised learning. There's also reinforcement learning, in which machines or software agents interact with an environment. Reinforcement learning agents are able to automatically figure out how to optimize their behavior given a system of rewards and punishments. Reinforcement learning draws inspiration from behavioral psychology and has applications in many fields such as economics, genetics, as well as game playing. In 2016, reinforcement learning was used to train Google DeepMind's AlphaGo, which was the first computer program to beat the world champion in go. But let's come back to supervised learning, which will be the focus of this course. In supervised learning, we have several data points or samples described using predictor variables or features and the target variable. Our data is commonly represented in a table structure, such as the one you see here, in which there is a row for each data point and a column for each feature. Here we see the iris data set. Each row represents measurements of a different flower, and each column is a particular kind of measurement, like the width and length of a certain part of the flower. The aim of supervised learning is to build a model that's able to predict the target variable here, the particular species of the flower given the predictive variables here, the physical measurements. If the target variable consists of categories like click or no click, spam or not spam, or different species of flowers, we call the learning task classification. Alternatively, if the target is a continuously varying variable, for example Price of a house, it's a regression task. In this chapter we will focus on classification and the following on regression A note on naming conventions out in the wild you'll find that what we call a feature others might call predictive variable or independent variable, and what we call the target variable others may call the dependent variable or response variable. The goal of supervised learning is frequently to either automate a time consuming or expensive manual task such as a doctor's diagnosis, or to make predictions about the future, say whether a customer will click on an ad or not. For supervised learning, you need labeled data and there are many ways to get it. You can get historical data which already has labels that you're interested in. You can perform experiments to get labeled data such as AB testing to see how many clicks you get. Or you can also use crowdsourced labeling data like ReCAPCHA does for text recognition. In any case, the goal is to learn from data for which the right output is known so that we can make predictions on new data for which we don't know the output. There are many ways to perform supervised learning in Python. In this course we will use scikit Learn or Sklearn, one of the most popular and user friendly machine learning libraries for Python. It also integrates very well with the SciPy stack, including libraries such as NumPy. There are a number of other ML libraries out there such as TensorFlow and Keras, which are worth checking out. Once you got down to basics, let's now jump into an exercise.
More from Richie

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon







