0% found this document useful (0 votes)
11 views39 pages

Understanding AI Algorithms Explained

The document provides an overview of AI algorithms, defining them as complex sets of instructions that enable computers to learn and operate autonomously. It categorizes AI algorithms into supervised, unsupervised, and reinforcement learning, detailing various algorithms within these categories such as decision trees, K-means clustering, and neural networks. Additionally, it discusses the principles of an Algorithmic Bill of Rights aimed at ensuring responsible use and accountability in algorithm design and implementation.

Uploaded by

ANJUPOONIA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views39 pages

Understanding AI Algorithms Explained

The document provides an overview of AI algorithms, defining them as complex sets of instructions that enable computers to learn and operate autonomously. It categorizes AI algorithms into supervised, unsupervised, and reinforcement learning, detailing various algorithms within these categories such as decision trees, K-means clustering, and neural networks. Additionally, it discusses the principles of an Algorithmic Bill of Rights aimed at ensuring responsible use and accountability in algorithm design and implementation.

Uploaded by

ANJUPOONIA
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

1

2
What is an AI Algorithm?
 The definition of an algorithm is “a set of instructions to be followed in
calculations or other operations.” This applies to both mathematics and
computer science. So, at the essential level, an AI algorithm is the
programming that tells the computer how to learn to operate on its own.

 An AI algorithm is much more complex than what most people learn about
in algebra, of course. A complex set of rules drive AI programs, determining
their steps and their ability to learn. Without an algorithm, AI wouldn’t
exist.
3
How do AI algorithms work?

 While a general algorithm can be simple, AI algorithms are by nature more complex. AI
algorithms work by taking in training data that helps the algorithm to learn. How that data
is acquired and is labeled marks the key difference between different types of AI
algorithms.

 At the core level, an AI algorithm takes in training data (labeled or unlabeled, supplied by
developers, or acquired by the program itself) and uses that information to learn and
grow.

 Then it completes its tasks, using the training data as a basis. Some types of AI algorithms
can be taught to learn on their own and take in new data to change and refine their
process. Others will need the intervention of a programmer in order to streamline.
4
Types of AI Algorithm
 There are three major categories of AI algorithms that we have already
learned in the previous modules, namely: supervised learning,
unsupervised learning, and reinforcement learning. The key differences
between these algorithms are in how they’re trained, and how they
function.

 Under those categories, there are dozens of different algorithms. We will


discuss about the most popular and commonly used from each category,
as well as where they are commonly used.
5
1. Supervised Learning Algorithms

 The first, and most used category of algorithms is


commonly learning.” These work by taking in clearly-labeled data
“Supervised
while being trained and using that to learn and grow. It uses the
labeled data to predict outcomes for other data.

 The name “supervised learning” comes from the comparison of a


student learning in the presence of a teacher or expert.
6

 Building a supervised learning algorithm that actually works takes a


team of dedicated experts to evaluate and review the results, not to
mention data scientists to test the models, the algorithm created to
ensure their accuracy against the original data, and catch any errors
from the AI.
Types of Supervised Learning Algorithms 7

1. Decision Tree
 One of the most common supervised
learning algorithms, decision trees get
their name because of their tree-like
structure (even though the tree is
inverted).
 The “roots” of the tree are the training
datasets and they lead to specific nodes
which denote a test attribute. Nodes often
lead to other nodes, and a node that
doesn’t lead onward is called a “leaf”.
8

2. Random Forest
 The random forest algorithm is actually a broad collection
of
different decision trees, leading to its name.

 The random forest builds different decision trees and


connects them to gain more accurate results.

 These can be used for both classification and regression type of


supervised learning.
9

 While a solo decision tree has one outcome and a narrow range of
groups, the forest assures a more accurate result with a bigger number
of groups and decisions.

 It has the added benefit of adding randomness to the model by finding


the best feature among a random subset of features. Overall, these
benefits create a model that has wide diversity that many data scientists
favor.
10

 As we can see from the diagram,


the results of decision tree 1,2
and 3 are combined, which is
then averaged out or the
majority is considered as the final
result.
11

3. Support Vector Machines

 The support vector machine (SVM) algorithm is another common AI algorithm


that can be used for either classification or regression (but is most often used
for classification).

 SVM works by plotting each piece of data on a chart (in N dimensional space
where N = the number of datapoints). Then, the algorithm classifies the
datapoints by finding the hyperplane that separates each class. There can be
more than one hyperplane.
12

 The main objective of a support vector


machine is to segregate the given dataset in
the best possible way. The distance between
the either nearest points is known as the
margin.

 The objective is to select a hyperplane with


the maximum possible margin between
support vectors in the given dataset. SVM
searches for the maximum marginal
hyperplane.
13

 Generate hyperplanes segregates the


classes in the best way. The figure on top shows
which
three hyperplanes black, blue and orange. Here,
the blue and orange have higher classification
error, but the black is separating the two classes
correctly.
 Select the right hyperplane with the maximum
segregation from the either nearest data points
as shown in the figure at the bottom.
4. Naive Bayes
 The reason this algorithm is called “Naive Bayes” is that it’s based on
Bayes’ Theorem, and also relies heavily on a large assumption: that the
presence of one particular feature is unrelated to the presence of other
features in the same class. That major assumption is the “naive” aspect of
the name.

 Naive Bayes is useful for large datasets with many different classes. It, like
many other supervised learning algorithms, is a classification algorithm.

23
15

 It is an algorithm that learns the probability of


every object, its features, and which groups
they belong to. It is also known as a
probabilistic classifier.

 For example, you cannot identify a bird based


on its features and color as there are many
birds with similar attributes. But, you make a
probabilistic prediction about the same, and
that is where the Naive Bayes Algorithm comes
in.
16

5. Linear regression

 Linear regression is a supervised learning AI algorithm used for regression


modeling. It’s mostly used for discovering the relationship between data
points, predictions, and forecasting.

 Much like Support Vector Machines, it works by plotting pieces of data on a


chart with the X-axis as the independent variable and the Y-axis as the
dependent variable. The data points are then plotted out in a linear fashion to
determine their relationship and forecast possible future data.
17

 Linear regression is one of the easiest and most popular Machine Learning
algorithms. It is a statistical method that is used for predictive analysis.
Linear regression makes predictions for continuous/real or numeric
variables such as sales, salary, age, product price, etc.

 Linear regression algorithm shows a linear relationship between a


dependent (y) and one or more independent (x) variables, hence called as
linear regression.
18

 Since linear regression shows the linear


relationship, which means it finds how
the value of the dependent variable is
changing according to the value of the
independent variable.

 The linear regression model provides a


sloped straight line representing the
relationship between the variables.
EXAMPLE OF SEARCH ALGORITH
M
20
Types of Unsupervised Learning
Algorithms

Unsupervised learning algorithms are given data that isn’t


labeled.

Unsupervised learning algorithms use that unlabeled data


to create models and evaluate the relationships between
different data points in order to give more insight to the
data.
21

1. K-means clustering

 K-means is an algorithm designed to perform the clustering function in


unsupervised learning. It does this by taking in the pre-determined
clusters and plotting out all the data regardless of the cluster.

 It then plots a randomly-selected piece of data as the centroid for each


cluster (think of it as a circle around each cluster, with that piece of data
as the exact center point).
22

 From there, it sorts the remaining data points into clusters


based on their proximity to each other and the centroid data
point for each cluster.

 The algorithm takes the unlabeled dataset as input, divides


the dataset into k-number of clusters, and repeats the
process until it does not find the best clusters. The value of k
should be predetermined in this algorithm.
23

The k-means clustering algorithm mainly performs two tasks:

 Determines the best value for K center points or centroids by


an iterative process.

 Assigns each data point to its closest k-center. Those data


points which are near to the particular k-center, create a
cluster.
24

The working of the K-Means algorithm is as follows:

1: Select the number K to decide the number of clusters.


2: Select random K points or centroids.
3: Assign each data point to their closest centroid,
which will form the predefined K clusters.
4: Calculate the variance and place a new centroid of each
cluster.
5: Repeat the third steps, which means reassign each
datapoint to the new closest centroid of each cluster.
25

2. Gaussian mixture model


 Gaussian mixture models are similar to K-means clustering in many ways. Both
are concerned with sorting data into pre-determined clusters based on
proximity.

 However, Gaussian models are a little more versatile in the shapes of the
clusters they allow.

 K-means clustering only allows data to be clustered in circles with the centroid
in the center of each cluster.
26

 Gaussian mixture can handle data that lands on the graph in more
linear patterns, allowing for oblong-shaped clusters. This allows for
greater clarity in clustering if one datapoint lands inside the circle of
another cluster.

 The starting point and training process of the KMeans and GMM are
the same. However, KMeans uses a distance-based approach, and
GMM uses a probabilistic approach.
27

 There is one primary assumption in GMM: the dataset consists of


multiple Gaussians, in other words, a mixture of the gaussian.

 It is used to forecast the sales of product, understand customer churn


through the lens of different groups of customers etc.

 Some AI algorithms can use either supervised or unsupervised data input


and still function. They might have slightly different applications based on
their status.
28

3. K-nearest neighbour algorithm

 K-nearest neighbor (KNN) algorithm is a simplistic AI algorithm that


assumes that all the data points provided are in proximity to each other
and plots them out on a map to show the relationship between them.

 Then the algorithm can calculate the distance between data points in
order to extrapolate their relationship, and calculate the distance on a
graph.
29

Used for both Supervised and Unsupervised Algorithms


 In supervised learning, it can be used for either classification or regression
applications. In unsupervised learning, it’s popularly used for anomaly
detection; that is, finding data that doesn’t belong and removing it.

 K-NN is a non-parametric algorithm, which means it does not make


any assumption on underlying data.
30

 It is also called a lazy learner algorithm because it does not learn from the
training set immediately, instead at the training phase, it just stores the
dataset and when it gets new data, it classifies that data into a category
that is much similar to the new data.

 K-NN algorithm can be used for Regression as well as for


Classification but mostly it is used for the Classification problems.
31

 Suppose there are two categories, i.e., Category A and Category B,


and we have a new data point x1, so this data point will lie in which
of these categories.
 To solve this type of problem,
we need a K-NN algorithm.
With the help of K-NN, we
can easily identify the
category or class of
particular dataset.
a
For both Supervised and Unsupervised 32

Algorithms

1. Neural Networks

 Neural network algorithm is a term for a collection of AI algorithms that


mimic the functions of a human brain. These tend to be more complex
than many of the algorithms discussed above and have applications which
are still being discovered.

 In unsupervised and supervised learning, it can be used for classification


and pattern recognition.
33

 It consists of interconnected nodes (neurons) organized into layers.


Information flows through these nodes, and the network adjusts the
connection strengths (weights) during training to learn from data, enabling
it to recognize patterns, make predictions, and solve various tasks in
machine learning and artificial intelligence.

 There are three layers in the network architecture: the input layer, the
hidden layer (more than one), and the output layer. Because of the
numerous layers, it is sometimes referred to as the MLP (Multi- Layer
Perceptron).
34

 It is possible to think of the hidden layer as a


“distillation layer,” which extracts some of the
most relevant patterns from the inputs and
sends them on to the next layer for further
analysis.

 It accelerates and improves the efficiency of


the network by recognizing just the most
important information from the inputs and
discarding the redundant information.
35
Types of Reinforcement Algorithms

 The last major type of AI is reinforcement learning


algorithm
algorithms, which learns by taking in feedback from the result of its
action. This is typically in the form of a “reward.

 A reinforcement algorithm is usually composed of two major parts:


an agent that performs an action, and the environment in which the
action is performed. The cycle begins when the environment sends a
“state” signal to the agent. That queues the agent to perform a
specific action within the environment.
36

 Once the action is performed, the environment sends a “reward” signal to


the agent, informing it on what happened, so the agent can update and
evaluate its last action. Then, with that new information, it can take the
action again. That cycle repeats until the environment sends a termination
signal.

 There are two types of reinforcement the algorithm can use:


either a positive reward, or a negative one.
37
Algorithmic Bill of Rights
 In January 2017, the US Public Policy Council of the Association for
Computing Machinery (ACM), which consists of educators, researchers, and
professionals in the world of information technology, outlined a set of
guiding principles that could serve as a precursor for an algorithmic bill of
rights.

 These principles cover seven general areas, which we will be discussing one
by one.
38
Principles of Algorithmic Bill

1. Awareness: Those who design, implement, and use algorithms must be


aware of their potential biases and possible harm, and take these into
account in their practices.

2. Access and redress: Those who are negatively affected by algorithms must
have systems that enable them to question the decisions and seek redress.

3. Accountability: Organizations that use algorithms must take responsibility


for the decisions those algorithms reach, even if it is not feasible to
explain how the algorithms arrive at those decisions.
39

4. Explanation: Those affected by algorithms should be given


explanations of the decisions and the procedures that generated them.

5. Data provenance: Those who design and use algorithms should maintain records on the data
used to train the algorithms and make those records available to appropriate individuals to be studied
for possible biases.

6. Auditability: Algorithms and data should be recorded so that they can be audited in cases of
possible harm.

7. Validation and testing: Organizations that use algorithms should test them regularly for bias and
make the results publicly available.

You might also like