This course is not mobile-friendly.
Please access this site on a desktop device.

Chapter 2

Now that we know a little more about AI, we'll learn how it works, how models are trained, and how we apply it to real-world situations.

SCROLL TO BEGIN

Table of Contents

Artificial Intelligence vs Machine Learning vs Deep Learning

Approaches for Developing Models

Supervised Learning

Unsupervised Learning

Reinforcement Learning

Artificial Intelligence

To review, AI is all about getting computers to do tasks that would normally require human intelligence, such as:

1
Mimicking human cognitive functions
2
Gathering information and solving problems
3
Using math and logic to simulate reasoning
4
Learning from new information and making decisions

Machine Learning

All machine learning is artificial intelligence, but not all artificial intelligence is machine learning.

Machine learning is a subset of AI where the model distills meaning and learns how to operate through exposure to training data.

Training data includes many examples of a situation, both the inputs and the outputs, to teach the program what patterns to look and solve for.

The machine learning solution then learns how to optimize variables without being given specific instructions, and can continuously improve as it gains experience.

Deep Learning

All deep learning is machine learning, but not all machine learning is deep learning.

Some machine learning algorithms are developed using artificial neural networks, inspired by the structure and function of the brain. When a model is designed with multiple layers of interconnected neural network modules, and each model continuously tunes each other, you have a deep learning solution.

Deep learning is the method that most often allows models to exceed human performance, and is showing a great deal of promise:

It's how self-driving cars classify the objects being detected by its sensors.

It's how cancer researchers are training models to automatically detect cancer cells in medical images.

It's being used in automated hearing and speech translation software, as well as home assistance devices like Alexa.

The Layers of a Deep Learning Solution

Three layers are necessary for a deep learning solution to work:

The Input Layer is the initial data that is being used to train our model.

The Hidden Layer is the middle layer (or multiple layers) where all the computation is done.

The Output Layer is where we get the results from the trained model.

The more hidden layers a neural network has, the longer it takes for the neural network to extract the data it needs to produce an accurate output and the more complex problems it can solve.

Different Approaches to Developing Models

Whether you're developing an artificial intelligence, machine learning, or deep learning solution, there are three main ways these models are developed:

Supervised Learning

Unsupervised Learning

Reinforcement Learning

We'll dive into each shortly.

Hyperparameters

Typically, a model won't be able to perform perfectly straight out of the box. Certain settings must be adjusted to get the best results.

These settings are called hyperparameters; they're the levers we adjust to train our models. They're initialized prior to training a model, and are tuned throughout testing to make it more accurate.

They directly impact the behavior of the training algorithm, which has substantial effect on the performance (accuracy, training time, and resource requirements) of the model being trained.

Measuring Success

As a model begins working on real data, its hyperparameters will be tuned to ensure it's generating the optimal outputs.

The goal to continually evaluating a model's performance is to improve the model's overall predictive power before it's rolled out to production for use on unseen data.

Models designed to properly assign labels to inputted data should be measured for how well they minimize the number of misclassifications (maximizes accuracy).

Models designed to predict a value should be measured for how well they minimize the prediction error: the difference between the predicted value and the actual, observed value.

Supervised Learning

Supervised learning is best used when you already know both what your inputs will be, and what your outputs should be.

The model gets exposed to a table of labeled "training" data, then teach it to classify that data or make predictions accurately.

The model will understand both the question and the answer, and will work to define the patterns between the two. When presented with never-before-seen data, it will be able to yield accurate labeling results.

It tries to understand why something happens, which in turn allows it to make predictions.

Labeled Data

Labeled data is a data set that has been classified according to identifiable characteristics. Labels set a foundation for reliable, repeatable learning patterns.

Typically a subset of the data (the "training data") will be manually labeled, and the algorithm will apply labels to the rest of the data based on the patterns it infers.

reinforcement learning label

Kinds of Supervised Learning

Supervised learning is typically one of two types: classification or regression.

Classification uses an algorithm to accurately assign test data into specific categories. It recognizes specific entities within the dataset and attempts to draw some conclusions on how those entities should be labeled or defined.

Regression

supervised learning label

Kinds of Supervised Learning

Supervised learning is typically one of two types: classification or regression.

Classification

Regression analysis is one of the most common forms of machine learning models. It works by estimating the relationship between variables, using a pre-defined mathematical algorithm, which allows it to predict accurate outputs when presented with novel inputs.

supervised learning label

Examples of Supervised Learning Models

Image- and object-recognition models can locate and categorize objects from videos and images, leading to all sorts of innovative analysis and applications.

Customer sentiment analysis models can extract and classify important information (like context, emotion, and intent) to better understand customer interactions and improve brand engagement efforts.

Spam detection models can train databases to recognize patterns and anomalies to organize spam and non-spam-related correspondences effectively.

Predictive analytics models can provide deep insights into various business data points, allowing leaders to anticipate certain results and justify decisions based upon model outputs.

Fitting a Model to the Data

Overfitting is a modeling error which occurs when a function is too closely fit to a limited set of data points.

Underfitting refers to a model that can neither model the training data nor generalize to new data.

Appropriate fitting refers to a model that has found the sweet spot between underfitting and overfitting, so it can establish a dominant trend and apply it broadly to new datasets.

Unsupervised Learning

Unsupervised learning is best used when we have a collection of unlabeled data, and we don't know the answer we're looking for.

We simply expose the model to a large swath of data, so it can find whatever patterns it's able to.

unsupervised learning label

Unlabeled Data

Unlabeled data is a table where rows have not been previously sorted or tagged with an identifying label.

Typically unlabeled data is fairly easy to obtain, but tends to be more difficult to work with. The majority of data collected starts out being unlabeled.

Some examples might include photos, audio clips, video files, tweets, news articles, medical scans - usually the raw output of some piece of software.

unsupervised learning label

Common Types of Unsupervised Learning Models

Clustering models find similarities in data points and group similar data points together.Once similar data is grouped together, you can begin to draw insights from the similarities, differences and patterns that are discovered.

Association Rule Learning

Dimensionality Reduction

unsupervised learning label

Common Types of Unsupervised Learning Models

Clustering

Association Rule Learning models find relationships or dependencies in data sets. The rules that are discovered help you make inferences about how or why certain items are connected. This type of learning can also help you understand whether and when certain data points are more likely to occur together.

Dimensionality Reduction

unsupervised learning label

How Unsupervised Learning Models Can be Used

Clustering

Association Rule Learning

Dimensionality Reduction models simplify data without losing critical information (often by merging several correlated features into one feature). When all variables and characteristics are available in a data set, there is often redundancy, which can negatively impact the model's training. Reducing to the minimum data needed resolves this.

unsupervised learning label

Examples of Unsupervised Learning Models

Computer vision models can accomplish visual perception tasks, such as object recognition.

Recommender engines can analyze patterns of behavior to make personalized recommendations for a user based on what a user has "liked" or purchased in the past, the behavior of others with similar habits, and the amount of time spent on the content.

Anomaly detection models can comb through large amounts of data and discover atypical data points within a dataset to raise awareness around faulty equipment, human error, or breaches in security.

Customer persona models can make it easier to understand common traits and purchasing habits, to build better buyer persona profiles, and enable organizations to align their product messaging more appropriately.

unsupervised learning label

Validating Unsupervised Learning Models

Mathematical checks are useful, but usually the ultimate test for an unsupervised model is subject matter expertise.

Interactive visualizations help experts examine and validate findings.

Subject matter experts may hand-label data points as a semi-supervised check on the model's technique.

A model may provide potential targets for an operation, then a subject matter expert can use tradecraft to validate those leads.

reinforcement learning label

Reinforcement Learning

In reinforcement learning, we teach a model to play a game. We define a single goal or a sequence of targeted outcomes.

Then the model is allowed to run through the scenario, devising its own solutions. Each solution is evaluated, and we code in reward mechanisms when the correct outcomes are achieved.

reinforcement learning label

Reinforcement Learning

The model is only coded to maximize its "score," no hints or suggestions are provided for how the model should go about solving the problem.

This approach takes many trials to generate results, but it is a taste of how algorithms can be creative.

Review what you learned

Match the term to its definition.