In Part I of this blog series, I described machine learning’s history as well as its current prevailing ideas. My introduction was purposely general because my objective was to cement in the reader’s mind exactly what machine learning is, and is not.
Here in Part II, I dig in a bit deeper and differentiate between the various categories of machine learning.
Recall from Part I that machine learning literally entails computers learning – either from data, or from their environment. In general, there are several ways in which computers learn (referred to here as categories).
Practically speaking, the appropriate category for a machine learning program can be dependent upon several factors. However, the single most influential factor is the data itself. Data type generally determines the category of machine learning.
Illustration 1 identifies each category of machine learning and the data type usually associated with it. The types of data include:
Labeled Data – data with qualitative descriptors. For example, patient information:
|Age||Gender||Height (in)||Weight (lb)||Hair Color||Eye Color||Smokes|
Unlabeled Data – data without qualitative descriptors. Examples include photos, audio, social media web scrapes, or machine data:
Environment – sensory feedback, to computer program, that determines rewards (persevere) or penalties (pivot)
What do you see in Illustration 2?
No doubt you recognize most of these items:
But how did you know the apple was an apple? Because at one point in your life someone told you it was an apple. You were taught.
In supervised learning, a computer program (model) is taught using training data. For example, suppose that I set out to train an algorithm to recognize the five fruits and vegetables listed above. The first and obvious thing to do is to describe, quantify, or categorize the items based on observable characteristics. In machine learning these are called features and the process of determining features is called feature selection.
In the example I present here, feature selection is somewhat simple. However, in a majority of machine learning exercises, feature selection is quite involved and not so intuitive. I will discuss feature selection in more depth in a later post.
Illustration 3 demonstrates several possible features (with sample data): Color, Texture, Shape, Avg Size, and Sweet. This data set is the teacher that will train an algorithm to identify other apples, chilis, etc.
Illustration 4 shows a possible approach to training a model to identify fruits and vegetables:
- Labeled training data is used to train a model. In this case, a decision tree classifier.
- The trained model is then used to process new data with the goal of classifying the data.
- The predicted class is returned.
To be fair, this is an oversimplification of the process and it doesn’t explain how the model works (coming in another post in this series).
The point is that supervised learning needs to be taught and labeled data is the teacher. The result of a supervised learning process is a trained model, usually in the form of a function which can include linear regression models, decision tree, plus many others.
This category of machine learning has no teacher other than its own sense of curiosity. It has no prior knowledge of the data fed into it which means it does not know anything about tomatoes or apples. In fact it has no idea that such a thing even exists.
Revisit illustration 2 above, and ask yourself, “What does a computer see?” Keep in mind the computer has no prior knowledge of these fruits and vegetables.
Illustration 5 represents an unlabeled representation of our fruits and vegetables. This is all that an unsupervised learning model would see. So again, what does a computer see?
Most unsupervised approaches to machine learning entail looking for meaningful groupings of data.
A meaningful grouping is determined by the algorithm used and by the nature of the data. Illustration 6 demonstrates several possible outcomes for a meaningful grouping.
- Grouping by texture
- Grouping by color
Another possible grouping could be based on shape, size, etc.
As with supervised learning above, this is an oversimplification of the process and it doesn’t explain how the model works (coming in another post in this series).
Unsupervised learning has no teacher and cannot predict. It can only create meaningful groupings. The output from an unsupervised model is a natural and meaningful grouping usually expressed visually.
Illustration 1 tells us that semi-supervised learning includes both labeled and unlabeled data. Typically, there is usually little labeled data but many unlabeled data. Semi-supervised learning is the merger of supervised and unsupervised learning.
It naturally follows that this approach is taught in a very restricted way. For example, in college there are typically Professors (teachers) and TA’s (teaching assistants) – semi-supervised learning uses a teaching assistant to assist in its learning.
The labeled (TA) data is used to help it create natural and meaningful groupings.
Today, 1.6 billion people have a Facebook account. When you create a Facebook account, it knows nothing about you or your images. However, through the process of “tagging,” a Facebook user acts as a teaching assistant.
After manually tagging one or two photos of the same person, Facebook will begin suggesting who is in the picture. In this example, the labeled training data are the manually tagged images. The unlabeled data are future images uploaded and identified by Facebook’s algorithm.
Up until now we have been shaping the various categories of machine learning in terms of labeled and unlabeled data. Reinforcement learning is a bit different in that it learns through a system of rewards or penalties (depending on the program).
Here the idea is that as an agent (program) takes actions (explorations) in an environment (known or unknown), it observes the result to identify if it is rewarded, which then determines its next action.
This process is cyclical and continuous.
Consider the robotic vacuum Roomba:
This device’s job is to continually clean floors without getting stuck under a chair, corner, or couch. The Roomba (agent) moves (action) in a room (environment) until it hits an obstacle which can be a chair leg, wall, door, etc (penalty). When this happens, it chooses a different direction and proceeds to clean (reward). The process, as a whole, ends when the floor is clean.
Reinforcement learning is used extensively in video game programming.
Note that the gamer also leverages reinforcement learning as he/she plays a game. How reinforcement is implemented is beyond the scope of this post; however, I do plan on covering this topic in detail in a later post.
Summary & Final Thoughts
Machine learning is generally broken out by Category:
- Supervised Learning
- Unsupervised Learning
- Semi-supervised Learning
- Reinforced Learning
Category is, in most part, determined by data and/or environment:
- Labeled: Supervised Learning
- Unlabeled: Unsupervised Learning
- Blend: Semi-Supervised Learning
- Environment: Reinforcement Learning
In Part III of this series, I will present the various techniques used in machine learning:
As always, I encourage your thoughts, feedback, and experiences.
[Opening Image] Lexalytics. Machine Learning. Image accessed April 2017 via URL
[Illustration 1] Frolio, L. (2017). Inspired by: Dataiku Hadoop Summit (slide 12). Semi-supervised learning with hadoop for understanding user web behavior. Accessed April 2017 via URL
[Illustration 4] Frolio, L. (2017). Inspired by: Schapire, Rob (Princeton University). Machine Learning for Classification. Accessed April 2017 via URL
[Illustration 7] Total Tech Blog. Facebook Messenger introduces face recognition tool. Image accessed April 2017 via URL
[Illustration 8] NVidia. Train Your Reinforcement Learning Agents at teh OpenAI Gym. Image accessed April 2017 via URL
[Illustration 9] Roomba. Image accessed April 2017 via URL
[Illustration 10] Mario Mayhem. Image accessed April 2017 via URL