PAIML - UNIT 4dfvdfvdfvdfvdfvvfdvsd.pptx

RoselinLourd 14 views 66 slides Aug 26, 2024
Slide 1
Slide 1 of 66
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66

About This Presentation

v dxv


Slide Content

Unit 4 Learning

Learning Types of Learning Rote Learning Learning by Parameter Adjustment Learning by General Problem Solving Concept Learning Learning by Analogy

What is Machine Learning In the real world, we are surrounded by humans who can learn everything from their experiences with their learning capability, and we have computers or machines which work on our instructions. But can a machine also learn from experiences or past data like a human does? So here comes the role of Machine Learning .

Machine Learning is said as a subset of artificial intelligence that is mainly concerned with the development of algorithms which allow a computer to learn from the data and past experiences on their own. The term machine learning was first introduced by Arthur Samuel in 1959 . We can define it in a summarized way as: Machine learning enables a machine to automatically learn from data, improve performance from experiences, and predict things without being explicitly programmed.

What is machine learning Machine learning (ML) is a type of artificial intelligence ( AI ) that allows software applications to become more accurate at predicting outcomes without being explicitly programmed to do so. Machine learning algorithms use historical data as input to predict new output values.

How does Machine Learning work

Why is machine learning important ? Machine learning is important because it gives enterprises a view of trends in customer behavior and business operational patterns, as well as supports the development of new products. Many of today's leading companies, such as Facebook, Google and Uber , make machine learning a central part of their operations. Machine learning has become a significant competitive differentiator for many companies.

Need for Machine Learning The need for machine learning is increasing day by day. The reason behind the need for machine learning is that it is capable of doing tasks that are too complex for a person to implement directly The importance of machine learning can be easily understood by its uses cases, Currently, machine learning is used in self-driving cars , cyber fraud detection , face recognition , and friend suggestion by Facebook , etc.

What are the different types of machine learning? Classical machine learning is often categorized by how an algorithm learns to become more accurate in its predictions. There are four basic approaches : supervised learning, unsupervised learning, semi-supervised learning reinforcement learning

Supervised learning In this type of machine learning, data scientists supply algorithms with labeled training data and define the variables they want the algorithm to assess for correlations. Both the input and the output of the algorithm is specified.

How does supervised machine learning work ? Supervised machine learning requires the data scientist to train the algorithm with both labeled inputs and desired outputs. Supervised learning algorithms are good for the following tasks: Binary classification: Dividing data into two categories. Multi-class classification: Choosing between more than two types of answers. Regression modeling: Predicting continuous values. Ensembling : Combining the predictions of multiple machine learning models to produce an accurate prediction.

How does unsupervised machine learning work ? Unsupervised machine learning algorithms do not require data to be labeled. They sift through unlabeled data to look for patterns that can be used to group data points into subsets. Most types of deep learning, including neural networks , are unsupervised algorithms. Unsupervised learning algorithms are good for the following tasks: Clustering: Splitting the dataset into groups based on similarity. Anomaly detection: Identifying unusual data points in a data set. Association mining: Identifying sets of items in a data set that frequently occur together. Dimensionality reduction: Reducing the number of variables in a data set .

How does semi-supervised learning work ? Semi-supervised learning works by data scientists feeding a small amount of labeled training data to an algorithm. From this, the algorithm learns the dimensions of the data set, which it can then apply to new, unlabeled data . Machine translation: Teaching algorithms to translate language based on less than a full dictionary of words. Fraud detection: Identifying cases of fraud when you only have a few positive examples. Labelling data: Algorithms trained on small data sets can learn to apply data labels to larger sets automatically.

How does reinforcement learning work ? Reinforcement learning works by programming an algorithm with a distinct goal and a prescribed set of rules for accomplishing that goal Robotics: Robots can learn to perform tasks the physical world using this technique. Video gameplay: Reinforcement learning has been used to teach bots to play a number of video games. Resource management: Given finite resources and a defined goal, reinforcement learning can help enterprises plan out how to allocate resources.

Reinforcement learning I s a feedback-based learning method, in which a learning agent gets a reward for each right action and gets a penalty for each wrong action. The agent learns automatically with these feedbacks and improves its performance. In reinforcement learning, the agent interacts with the environment and explores it. The goal of an agent is to get the most reward points, and hence, it improves its performance. The robotic dog, which automatically learns the movement of his arms, is an example of Reinforcement learning.

Intelligent Agent Intelligent Agents can be any entity or object like human beings, software, machines. These agents can make decisions based on the inputs from the environment using its sensors and act on the environment using actuators. AI-Enabled agents collect input from the environment by using sensors like cameras, microphones or other sensing devices. Then, the agents perform some real-time computation on the input and deliver output using actuators like screens or speakers. These agents have abilities like Real-Time problem solving, Error or Success rate analysis and information retrieval.

Association Rule Learning Association rule learning is a type of unsupervised learning technique that checks for the dependency of one data item on another data item and maps accordingly so that it can be more profitable. It tries to find some interesting relations or associations among the variables of dataset. It is based on different rules to discover the interesting relations between variables in the database

The association rule learning is one of the very important concepts of machine learning , and it is employed in Market Basket analysis, Web usage mining, continuous production, etc. Here market basket analysis is a technique used by the various big retailer to discover the associations between items.

We can understand it by taking an example of a supermarket, as in a supermarket, all products that are purchased together are put together. For example, if a customer buys bread, he most likely can also buy butter, eggs, or milk, so these products are stored within a shelf or mostly nearby. Consider the below diagram:

Association rule learning can be divided into three types of algorithms: Apriori Eclat F-P Growth Algorithm

How does Association Rule Learning work? Association rule learning works on the concept of If and Else Statement, such as if A then B . Here the If element is called antecedent , and then statement is called as Consequent

Association Rule Learning As briefly mentioned in the introduction, association rule learning is a rule-based machine learning method for discovering interesting relations between variables in large databases. Let’s use a simple supermarket shopping basket analysis to explain how the association rules are found

Assume we analyze the above transaction data to find frequently bought items and determine if they are often purchased together. To help us find the answers, we will make use of the following 3 metrics : Support Confidence Lift

Support Support(A ) = Transactions(A) / Total Transactions So in our example: Support(Eggs) = 3/6 = 1/2 = 0.5 Support(Bacon) = 4/6 = 2/3 = 0.667 Support(Apple) = 2/6 = 1/3 = 0.333 ... Support( Eggs&Bacon ) = 3/6 = 0.5 We typically want to focus computing resources to search for associations between frequently bought items while discounting the infrequent ones. For the sake of our example, let’s set minimum support to 0.5 , which leaves us to work with Eggs and Bacon for the rest of this example

Confidence Now that we have identified frequently bought items let’s calculate confidence. This will tell us how confident (based on our data) we can be that an item will be purchased, given that another item has been purchased Confidence(A→B) = Probability(A & B) / Support(A)

Confidence( Eggs→Bacon ) = P(Eggs & Bacon) / Support(Eggs) = (3/6) / (3/6) = 1 Confidence( Bacon →Eggs ) = P(Eggs & Bacon) / Support(Bacon) = (3/6) / (2/3) = 3/4 = 0.75 The above tells us that whenever eggs are bought, bacon is also bought 100% of the time. Also, whenever bacon is bought, eggs are bought 75% of the time.

lift . Given that different items are bought at different frequencies, how do we know that eggs and bacon really do have a strong association, and how do we measure it? You will be glad to hear that we have a way to evaluate this objectively using lift .

Lift(A→B) = Probability(A & B) / (Support(A) * Support(B )) You should be able to spot that we can simplify this formula by replacing P(A&B)/Sup(A) with Confidence(A→B). Hence , we have : Lift(A →B) = Confidence(A & B) / Support(B)

Lift( Eggs→Bacon ) = Confidence( Eggs→Bacon ) / Support(Bacon) = 1 / (2/3) = 1.5 Lift( Bacon →Eggs ) = Confidence( Bacon→Eggs ) / Support(Eggs) = (3/4) / (1/2) = 1.5 Lift for the two items is equal to 1.5 . Note, lift>1 means that the two items are more likely to be bought together, while lift<1 means that the two items are more likely to be bought separately. Finally , lift=1 means that there is no association between the two items.

Types of Association Rule Lerning Association rule learning can be divided into three algorithms : Apriori Algorithm Eclat Algorithm F-P Growth Algorithm

Apriori Algorithm This algorithm uses frequent datasets to generate association rules. It is designed to work on the databases that contain transactions. This algorithm uses a breadth-first search and Hash Tree to calculate the itemset efficiently. It is mainly used for market basket analysis and helps to understand the products that can be bought together. It can also be used in the healthcare field to find drug reactions for patients.

Apriori algorithm Apriori is a pretty straightforward algorithm that performs the following sequence of calculations: Calculate support for item sets of size 1. Apply the minimum support threshold and prune item sets that do not meet the threshold. Move on to item sets of size 2 and repeat steps one and two. Continue the same process until no additional item sets satisfying the minimum threshold can be found.

To make the process more visual

Applications of Association Rule Learning It has various applications in machine learning and data mining. Below are some popular applications of association rule learning : Market Basket Analysis: It is one of the popular examples and applications of association rule mining. This technique is commonly used by big retailers to determine the association between items. Medical Diagnosis: With the help of association rules, patients can be cured easily, as it helps in identifying the probability of illness for a particular disease. Protein Sequence: The association rules help in determining the synthesis of artificial Proteins. It is also used for the Catalog Design and Loss-leader Analysis and many more other applications.

Fuzzy Logic What is Fuzzy Logic in AI and What are its Applications?

In our day to day life, we might face situations where we are unable to determine whether the state is true or false. Fuzzy refers to something which is unclear or vague. Fuzzy Logic in AI provides valuable flexibility for reasoning. we will learn about this logic and its implementation in  Artificial Intelligence  in the following sequence

What is Fuzzy Logic? Fuzzy Logic  (FL) is a method of reasoning that resembles  human reasoning . This approach is similar to how humans perform decision making. And it involves all intermediate possibilities between  YES  and  NO .

The conventional logic block that a computer can understand takes precise input and produces a definite output as TRUE or FALSE, which is equivalent to human’s YES or NO. The inventor of fuzzy logic, Lotfi Zadeh , observed that unlike computers, the human decision making includes a range of possibilities between YES and NO, such as CERTAINLY YES POSSIBLY YES CANNOT SAY POSSIBLY NO CERTAINLY NO

Why do we use Fuzzy Logic? Generally, we use the fuzzy logic system for both commercial and practical purposes such as: It  controls machines  and  consumer products If not accurate reasoning, it at least provides  acceptable reasoning This helps in dealing with the  uncertainty in engineering So, now that you know about Fuzzy logic in AI and why do we actually use it, let’s move on and understand the architecture of this logic.

Fuzzy Logic Systems Architecture

Fuzzy Logic Systems Architecture It has four main parts as shown Rules  – It contains all the rules and the if-then conditions offered by the experts to control the decision-making system. The recent update in the fuzzy theory provides different effective methods for the design and tuning of  fuzzy controllers . Usually, these developments reduce the number of fuzzy rules. Fuzzification  – This step converts inputs or the crisp numbers into fuzzy sets. You can measure the crisp inputs by sensors and pass them into the  control system  for further processing. It splits the input signal into five steps such as-

Inference Engine  – It determines the degree of match between fuzzy input and the rules. According to the input field, it will decide the rules that are to be fired. Combining the fired rules, form the control actions. Defuzzification  – The Defuzzification process converts the fuzzy sets into a crisp value. There are different types of techniques available, and you need to select the best-suited one with an expert system.

This was about the architecture of fuzzy logic in AI. Now, let’s understand the membership function Membership Function The membership function is a  graph  that defines how each point in the  input space  is mapped to membership value between 0 and 1. It allows you to  quantify linguistic terms  and represent a fuzzy set graphically. A membership function for a fuzzy set A on the universe of discourse X is defined as  μA:X → [0,1]

It quantifies the degree of membership of the element in X to the fuzzy set A. x-axis  represents the universe of discourse. y-axis  represents the degrees of membership in the [0, 1] interval There can be multiple membership functions applicable to fuzzify a numerical value. Simple membership functions are used as the complex functions do not add precision in the output. The membership functions for  LP, MP, S, MN, and LN  are:

Applications of Fuzzy Logic The Fuzzy logic is used in various fields such as automotive systems, domestic goods, environment control, etc. Some of the common applications are: It is used in the  aerospace field  for  altitude control  of spacecraft and satellite. This controls the  speed and traffic  in the  automotive systems. It is used for  decision making support systems  and personal evaluation in the large company business. It also controls the pH, drying, chemical distillation process in the  chemical industry . Fuzzy logic is used in  Natural language processing  and various intensive  applications in Artificial Intelligence . It is extensively used in  modern control systems  such as expert systems. Fuzzy Logic mimics how a person would make decisions, only much faster. Thus, you can use it with  Neural Networks .

Advantages & Disadvantages of Fuzzy Logic The structure of Fuzzy Logic Systems is  easy and understandable Fuzzy logic is widely used for  commercial  and  practical purposes It helps you to  control machines  and consumer products It helps you to deal with the  uncertainty in engineering

Example of a Fuzzy Logic System This system adjusts the temperature of air conditioner by comparing the room temperature and the target temperature value.

Algorithm Define linguistic Variables and terms (start) Construct membership functions for them. (start) Construct knowledge base of rules (start) Convert crisp data into fuzzy data sets using membership functions. ( fuzzification ) Evaluate rules in the rule base. (Inference Engine) Combine results from each rule. (Inference Engine) Convert output data into non-fuzzy values. ( defuzzification )

Development Step 1 − Define linguistic variables and terms Linguistic variables are input and output variables in the form of simple words or sentences. For room temperature, cold, warm, hot, etc., are linguistic terms. Temperature (t) = {very-cold, cold, warm, very-warm, hot} Every member of this set is a linguistic term and it can cover some portion of overall temperature values.

Step 2 − Construct membership functions for them The membership functions of temperature variable are

Step3 − Construct knowledge base rules Create a matrix of room temperature values versus target temperature values that an air conditioning system is expected to provide .

Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures.

Step 4 − Obtain fuzzy value Fuzzy set operations perform evaluation of rules. The operations used for OR and AND are Max and Min respectively. Combine all results of evaluation to form a final result. This result is a fuzzy value.

Step 5 − Perform defuzzification Defuzzification is then performed according to membership function for output variable

Fuzzy Set Theory To learn about classical and Fuzzy set theory, firstly you have to know about what is set. Set A set is a term, which is a collection of unordered or ordered elements. Following are the various examples of a set: A set of all-natural numbers A set of students in a class. A set of all cities in a state. A set of upper-case letters of the alphabet.

Types of Set : Finite Empty Infinite Proper Universal Subset Singleton Equivalent Set Disjoint Set

Classical Set It is a type of set which collects the distinct objects in a group. The sets with the crisp boundaries are classical sets. In any set, each single entity is called an element or member of that set.

Mathematical Representation of Sets Any set can be easily denoted in the following two different ways 1. Roaster Form: This is also called as a tabular form. In this form, the set is represented in the following way: Set_name = { element1, element2, element3, ......, element N} The elements in the set are enclosed within the brackets and separated by the commas. Following are the two examples which describes the set in Roaster or Tabular form: Example 1: Set of Natural Numbers: N={1, 2, 3, 4, 5, 6, 7, ......,n).

2. Set Builder Form: Set Builder form defines a set with the common properties of an element in a set. In this form, the set is represented in the following way : A = { x:p (x)} The following example describes the set in the builder form: The set {2, 4, 6, 8, 10, 12, 14, 16, 18} is written as: B = {x:2 ≤ x < 20 and (x%2) = 0}

Operations on Classical Set Following are the various operations which are performed on the classical sets: Union Operation Intersection Operation Difference Operation Complement Operation

Properties of Classical Set 1. Commutative Property 2. Associative Property 3. Idempotency Property 4. Absorption Property 5. Distributive Property 6. Identity Property 7. Transitive property 8. Ivolution property 9. De Morgan's Law
Tags