0% found this document useful (0 votes)
52 views22 pages

ML 15 09 2022

Here are the key steps: 1. Find all frequent itemsets with minimum support of 50%: {Milk}: 60% {Bread}: 70% {Milk, Bread}: 50% 2. Generate strong association rules with minimum confidence of 70%: Milk -> Bread: 80% Bread -> Milk: 71% So the only rule generated is Milk -> Bread since it meets both minimum support and minimum confidence thresholds.

Uploaded by

saibaba8998
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)
52 views22 pages

ML 15 09 2022

Here are the key steps: 1. Find all frequent itemsets with minimum support of 50%: {Milk}: 60% {Bread}: 70% {Milk, Bread}: 50% 2. Generate strong association rules with minimum confidence of 70%: Milk -> Bread: 80% Bread -> Milk: 71% So the only rule generated is Milk -> Bread since it meets both minimum support and minimum confidence thresholds.

Uploaded by

saibaba8998
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
You are on page 1/ 22

Machine Learning

Summary of Unit 2

• Draw and explain the flow diagram of machine learning procedure


• What are the basic data types in machine learning? Give an example of each one of them.
• Why do we need to explore data? Is there a difference in the way of exploring qualitative data vis-
a-vis quantitative data?
• What are the different measures of central tendency? Why do mean, in certain data sets, differ
widely from median?
• Explain how bivariate relationships can be explored using scatter plot. Can outliers be detected
using scatter plot?
• What is BOX plot? How it can use to detect outlier? Draw a Box plot for given data
• Explain, in details, the different strategies of addressing missing data values.
• Explain, with proper example, different ways of exploring categorical data.
• What are the Techniques Provided in Data Preprocessing? Explain in brief.
Summary of Unit 2
Example: Box-Plot

Construct a box plot for the following data: 12, 5, 22, 30, 7, 36, 14, 42, 15, 53, 25
Outlier detection using Box Plot

An outlier, is one that appears to deviate markedly from other members of the data set
in which it occurs.

 Inter-Quartile Range (IQR) is the distance between the first and


second quartiles.
 Multiply the IQR by 1.5.
 Subtract that value from the 1st Quartile to get your lower
boundary.
 Add that value to the 2nd Quartile to get your upper boundary.
 Values in the data set that fall outside of these limits are considered
outliers.
Outlier detection using Box Plot: Example 2

24, 58, 61, 67, 71, 73, 76, 79, 82, 83, 85, 87, 88, 88, 92, 93, 94, 97

Median= 82+83/2 =82.5


IQR = Q3 - Q1 = 88 - 71 = 17.
Lower limit = Q1 - 1.5 · IQR = 71 - 1.5 *17 = 45.5
Upper limit = Q3 + 1.5 · IQR = 88 + 1.5 * 19 = 113.5
Lower adjacent value = 58
Upper adjacent value = 97
Since 24 lies outside the lower and upper limit, it is a potential outlier.
Summary of Unit 4

• Explain the need of feature engineering in ML.


• Explain the process of encoding nominal variables.
• Explain the process of transforming numeric features to categorical features
• What are the different distance measures that can be used to determine similarity of features?
• When can a feature be termed as redundant? What are the measures to determine the potentially
redundant features?
• Why is cosine similarity a suitable measure in context of text categorization? Two rows in a document-
term matrix have values - (2, 3, 2, 0, 2, 3, 3, 0, 1) and (2, 1, 0, 0, 3, 2, 1, 3, 1). Find the cosine similarity.
• How can we calculate Hamming distance? Find the Hamming distance between 10001011 and
11001111.
• Differentiate PCA and LDA
• Discuss different feature selection process (Filter, Wrapper, Hybrid, Embedded)
• Explain the overall process of feature selection
Cosine similarity measure

So let’s calculate the cosine similarity of x and y,


x = (2,4,0,0,2,1,3,0,0) and
y = (2,1,0,0,3,2,1,0,1).

x.y = 2*2 + 4*1 + 0*0 + 0*0 + 2*3 + 1*2 + 3*1 + 0*0 + 0*1 = 19.
Summary of Unit 5

• Examples using marginal probabilities and Bayes' theorem


Joint probabilities
 Joint probability is the probability of two events occurring simultaneously.
 For example, an expression of P(height, nationality) describes the probability of a
person has some particular height and has some particular nationality. Therefore,
P(height=165cm, nationality=Australian) = 0.5 means there is 0.5 chances of a
person, picked from a population, is an Australian and has the height of 165cm.

 The probability of the joint event A and B is defined as the product rule:

 where p(A|B) is defined as the conditional probability of event A happening if event B


happens.
Marginal probability
 Marginal probability is the probability of the occurrence of the single event. i.e.
Marginal probability is the probability of an event irrespective of the outcome of
another variable.

 It is just the sum or union over all the probabilities of all events for the second
variable for a given fixed event for the first variable.
P(X=A) = sum P(X=A, Y=yi) for all y
Conditional probability
 The conditional probability for events A given event B is calculated as follows:

Similarly ,
Bayes rule
 The Bayes rule, also known as Bayes Theorem, can be derived by combining the
definition of conditional probability with the product and sum rules, as below
Example
 An antibiotic resistance test (random variable T) has 1% false positives (i.e. 1% of
those not resistance to an antibiotic show positive result in the test) and 5% false
negatives (i.e. 5% of those actually resistant to an antibiotic test negative). Let us
assume that 2% of those tested are resistant to antibiotics.
 Determine the probability that somebody who tests positive is actually resistant
(random variable D).

D= man actually resistant to antibiotic


PT= Positive test result
P(D=1/PT=1)=?
Example
Solution:
D= man actually resistant to antibiotic
PT= Positive test result
1% false positive (FP) => 99% True Negative (TN)
5%false negative(FN)=> 95% True Positive (TP)
P(D=1)=0.02
P(D=0)=0.98
P(PT=1 |D=1)=0.95 =
P(PT=0|D=0)=0.99
P(PT=0|D=1)=0.05 =0.66
P(PT=1|D=0)=0.01
P(D=1|PT=1)=?
Example
 In an airport security checking system, the passengers are checked to find out any
intruder. Let I with i∈ {0, 1} be the random variable which indicates whether
somebody is an intruder (i = 1) or not (i = 0) and A with a ∈ {0, 1} be the variable
indicating alarm. An alarm will be raised if an intruder is identified with probability P(A
= 1|I = 1) = 0.98 and a nonintruder with probability P(A = 1|I = 0) = 0.001, which
implies the error factor. In the population of passengers, the probability of someone is
intruder is P(I = 1) = 0.00001. What is the probability that an alarm is raised when a
person actually is an intruder?
Example
This can be solved directly with the Bayesian theorem
Example
 For preparation of the exam, a student knows that one question is to be solved in the
exam which is either of types A, B, or C. The probabilities of A, B, or C appearing in the
exam are 30%, 20%, and 50% respectively. During the preparation, the student solved
9 of 10 problems of type A, 2 of 10 problems of type B, and 6 of 10 problems of type
C.

1. What is the probability that the student will solve the problem of the exam?
2. Given that the student solved the problem, what is the probability that it was of type
A?
Example
 P(Solved)=0.61
 P(A)=30%
 P(B)=20%
 P(C)=50%
 P(Solved | A)=9/10
 P(Solved | B)=2/10
 P(Solved | C)=6/10
1. What is the probability that the student will solve the problem of the exam?
Example
 Solution
 P(A)=30%
 P(B)=20%
 P(C)=50%
 P(Solved | A)=9/10
 P(Solved | B)=2/10
 P(Solved | C)=6/10
2. Given that the student solved the problem, what is the probability that it was of type
A?
Summary of Unit 8

• Examples apriori algorithm

Solve Apriori algorithm on the following data set with minimum support value
and minimum confidence value set as 50% and 75% respectively to generate
large itemsets and association rules
Summary of Unit 8

• Examples apriori algorithm

Generate frequent itemsets and generate association rules based on it using


apriori algorithm. Minimum support is 50% and minimum confidence is 70%

You might also like