Machine Learning: An Overview
Tags: machinelearning
Published: 2019-01-22 00:38:21

---
title: "Machine Learning: An Overview"
published: true
description: The three major branches of ML
tags: Machine Learning
---

*This is the first in a series of class notes as I go through the [Georgia Tech/Udacity Machine Learning course](https://www.udacity.com/course/machine-learning--ud262). The class textbook is [Machine Learning by Tom Mitchell](https://www.cs.ubbcluj.ro/~gabis/ml/ml-books/McGrawHill%20-%20Machine%20Learning%20-Tom%20Mitchell.pdf).*

![http://i.imgur.com/a69NtFM.jpg](http://i.imgur.com/a69NtFM.jpg)

## Supervised Learning: Learning by Approximation

Supervised Learning takes **labeled** data sets and gleaning information **so that you can label new data sets**. An example is if you look at this table:

| x | y |
|---|---|
| Chihuahua | A |
| German Shepherd | A |
| Siamese | B |
| Persian | B |
| Poodle | ? |

You might fill in `?` with `A`. You do this despite not being told what `x`, `y`, `A`, or `B` are, but because you had a labeled data set with 4 examples, you were able to infer the right answer (together with some contextual knowledge about dog and cat breeds, which in reality is usually not present in machines but is more interesting to look at than a bunch of numbers).

More generally, you can view this as **function approximation** where you suppose that your labeled data is the outcome of an unknown "real" function, and you are trying to get as close to it as possible with your machine learning algorithm. **Approximation** is a key word here - the unknown function can be marvelously complex, but as long as our approximation walks, talks, and quacks close enough to the real thing (and for [noisy domains this is a very useful assumption!](http://i.stanford.edu/hazy/papers/hogwild-nips.pdf)) then that works for us. Fortunately we have proof that [neural networks](https://en.wikipedia.org/wiki/Universal_approximation_theorem) and [functions](https://en.wikipedia.org/wiki/Approximation_theory) in general can be approximated with deliberate control over accuracy.

**The problem of Induction**

Notice that if in the above example the real function were simply "is x longer than 7 characters?" then the correct answer would be `B`, not `A`. 

This presents the problem with generalizing from an incomplete set of data points. Philosophers have long been [familiar with the Problem of Induction](https://en.wikipedia.org/wiki/Problem_of_induction#Ancient_and_early_modern_origins). Supervised learning leans on Induction to go from specific data points to general rules, as opposed to Deduction, where you have axioms/rules and you deduce only what can be concluded from those rules. 

**Classification vs Regression**

- **Classification** is the process of taking some kind of input `x` and mapping to a **discrete** label, for example True or False. So for example, given a picture, asking if [it is or is not a Hotdog](https://www.youtube.com/watch?v=ACmydtFDTGs).
- **Regression** is more about **continuous** value functions, like plotting a line chart through a scatter plot.

## Unsupervised Learning: Learning by Description

With Unsupervised Learning, we don't get the benefit of labels. We just get a bunch of data and have to figure out some internal structure within what we're given:


| x | y |
|---|---|
| Chihuahua | ? |
| German Shepherd | ? |
| Siamese | ? |
| Persian | ? |
| Poodle | ? |


Here our goal is to find interesting and useful ways to **describe** our dataset. These descriptions are useful and concise ways to "cluster", "compress" or "summarize" the dataset. This reductionism necessarily loses some details in favor of a more simple model, so we must try to come up with algorithms to decide which are the more important details worth keeping.

Unsupervised learning can be used as an input to Supervised learning, where the features it identifies can form useful labels for faster Supervised learning.

## Reinforcement Learning: Learning by Delayed Reward

In RL we try to learn like how people learn, as individual smart agents interacting with other smart agents, and trying to figure out what to do over time. The problem with creating an algorithm for this is that often the reward or outcome isn't determined based on a single set of decisions alone, but rather a sequence of them.

For example, placing an X or O on a blank game of Tic-Tac-Toe doesn't immediately tell you if that was a good or bad move, especially if you don't know the rules. We can only tell if it was a "better" or "worse" move by playing out all possible games after that starting point, tallying up wins and losses, and working backwards. This is modeled as a [Markov Decision Process](https://en.wikipedia.org/wiki/Markov_decision_process).

More generally, RL describes problems where you are given a set of valid decisions or actions to make, but have no idea how they impact the eventual outcome that you want, and having to figure out how to make those decisions at each step of the way.

## Comparison of SL, UL and ML

The truth is, these categories aren't all that distinct. In SL there is the problem of induction, so it might seem that UL is better due to its agnosticism. But in practice, what we choose to cluster or emphasize involves some implicit assumptions we impose anyway. In some sense you can turn any SL problem into an UL problem.

You can also view these approaches as different kinds of optimization:

- in SL you want something that labels data well - so you try to approximate a function that does that
- in RL you want behavior that scores well
- in UL you make up some criterion and then find clusters that organize the data so that it scores well on the criterion

Everything boils down to one thing: **DATA**. Data is king in all Machine Learning, and more data generally helps. However more importantly, all these approaches assume Data is clean, consistent, trustworthy, and unbiased. They all start with data (even if the data is generated), not, for example, a theoretical hypothesis like how the human scientific method might suggest.


![https://blogs.sas.com/content/subconsciousmusings/files/2017/09/styles-of-learning.jpg](https://blogs.sas.com/content/subconsciousmusings/files/2017/09/styles-of-learning.jpg)

## Further Resources

Class notes from other students going thru the class:

- [Flash Cards](https://www.brainscape.com/p/1VTHS-LH-75H06)
- [Lecture Notes for the first half of the class](https://docs.google.com/document/u/1/d/1pmLYTz2_P1_Z-8nuQUyT7ucgRgn0cRLwOA2r4-P-rGI/mobilebasic#heading=h.kmosjdeu4zh) - [More notes](https://github.com/mohamedameen93/Machine-Learning-Notes)
- [Notes for the entire class](https://github.com/mohamedameen93/Machine-Learning-Notes)

## Next in our series

Hopefully this has been a good high level overview of Machine Learning. I am planning more primers and would love your feedback and questions on:



- [Overview](https://dev.to/swyx/machine-learning-an-overview-216n)
- Supervised Learning
    - [Decision Trees](https://dev.to/swyx/machine-learning-classification-learning--decision-trees-1mbh)
    - [Regression](https://dev.to/swyx/supervised-learning-regression-4d17)
    - [Neural Networks](https://dev.to/swyx/supervised-learning-neural-networks-mpo)
    - [Instance Based Learning (K Nearest Neighbors)](https://dev.to/swyx/supervised-learning-instance-based-learning-and-k-nearest-neighbors-kge)
    - [Ensemble Learning (AdaBoost)](https://dev.to/swyx/supervised-learning-ensemble-learning-lim)
    - [Kernel Methods & SVMs](https://dev.to/swyx/supervised-learning-support-vector-machines-3mgk)
    - [Computational Learning Theory](https://dev.to/swyx/supervised-learning-computational-learning-theory-160h)
    - [VC Dimensions](https://dev.to/swyx/supervised-learning-vc-dimensions-10b)
    - [Bayesian Learning](https://dev.to/swyx/supervised-learning-bayesian-learning-403l)
    - [Bayesian Inference](https://dev.to/swyx/supervised-learning-bayesian-inference-4l72)
- Unsupervised Learning
    - [Randomized Optimization](https://dev.to/swyx/unsupervised-learning-randomized-optimization-4c1i)
    - [Information Theory](https://dev.to/swyx/unsupervised-learning-information-theory-recap-4iem)
    - [Clustering](https://dev.to/swyx/unsupervised-learning-clustering-42mi)
    - [Feature Selection](https://dev.to/swyx/unsupervised-learning-feature-selection-84f)
    - [Feature Transformation](https://dev.to/swyx/unsupervised-learning-feature-transformation-pcf)
- Reinforcement Learning
    - Markov Decision Processes - week of Mar 25
    - "True" RL - week of Apr 1
    - Game Theory - week of Apr 15