Uploaded by 吴鎏

ML - Candidate Elimination Algorithm - GeeksforGeeks

advertisement
2022/3/24 14:42
ML - Candidate Elimination Algorithm - GeeksforGeeks
ML – Candidate Elimination Algorithm
Difficulty Level : Easy
●
Last Updated : 17 Mar, 2021
The candidate elimination algorithm incrementally builds the version space given a
hypothesis space H and a set E of examples. The examples are added one by one;
each example possibly shrinks the version space by removing the hypotheses that
are inconsistent with the example. The candidate elimination algorithm does this by
updating the general and specific boundar y for each new example.
You can consider this as an extended form of Find-S algorithm.
Consider both positive and negative examples.
Actually, positive examples are used here as Find-S algorithm (Basically they are
generalizing from the specification).
While the negative example is specified from generalize form.
Terms Used:
Concept learning : Concept learning is basically learning task of the machine
(Learn by Train data)
General Hypothesis : Not Specif ying features to learn the machine.
G = {‘?’, ‘?’,’?’,’?’…}: Number of attributes
Specific Hypothesis : Specif ying features to learn machine (Specific feature)
S= {‘pi’,’pi’,’pi’…}: Number of pi depends on number of attributes.
Version Space : It is intermediate of general hypothesis and Specific hypothesis. It
not only just written one hypothesis but a set of all possible hypothesis based on
Data Structures
Algorithms
training data-set.
Interview Preparation
Topic-wise Practice
C++
Java
Python
Algorithm:
Step1: Load Data set
Step2: Initialize General Hypothesis
Step3: For each training example
https://www.geeksforgeeks.org/ml-candidate-elimination-algorithm/
▲
and Specific
Hypothesis.
1/6
2022/3/24 14:42
ML - Candidate Elimination Algorithm - GeeksforGeeks
Step4: If example is positive example
if attribute_value == hypothesis_value:
Start Your Coding
Journey Now!
Do nothing
Login
Register
else:
replace attribute value with '?' (Basically generalizi
Step5: If example is Negative example
Make generalize hypothesis more specific.
Example :
Consider the dataset given below:
Algorithmic steps :
Initially : G = [[?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?], [?, ?, ?,
[?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?], [?, ?, ?,
S = [Null, Null, Null, Null, Null, Null]
For instance 1 : <'sunny','warm','normal','strong','warm ','same'>
G1 = G
S1 = ['sunny','warm','normal','strong','warm ','same']
▲
For instance 2 : <'sunny','warm','high','strong','warm ','same'> an
https://www.geeksforgeeks.org/ml-candidate-elimination-algorithm/
2/6
2022/3/24 14:42
ML - Candidate Elimination Algorithm - GeeksforGeeks
G2 = G
S2 = ['sunny','warm',?,'strong','warm ','same']
Start Your Coding Journey Now!
Login
Register
For instance 3 : <'rainy','cold','high','strong','warm ','change'>
G3 = [['sunny', ?, ?, ?, ?, ?], [?, 'warm', ?, ?, ?, ?]
[?, ?, ?, ?, ?, ?], [?, ?, ?, ?, ?, ?], [?, ?, ?,
S3 = S2
For instance 4 : <'sunny','warm','high','strong','cool','change'> a
G4 = G3
S4 = ['sunny','warm',?,'strong', ?, ?]
At last, by synchronizing
the G4 and S4 algorithm produce the outp
Output :
G = [['sunny', ?, ?, ?, ?, ?], [?, 'warm', ?, ?, ?, ?]]
S = ['sunny','warm',?,'strong', ?, ?]
Attention reader! Don’t stop learning now. Get hold of all the impor tant Machine
Learning Concepts with the Machine Learning Foundation Course at a student-
friendly price and become industr y ready.
Like
Previous
17
Next
▲
https://www.geeksforgeeks.org/ml-candidate-elimination-algorithm/
3/6
2022/3/24 14:42
ML - Candidate Elimination Algorithm - GeeksforGeeks
Start Your Coding Journey Now!
RECOMMENDED ARTICLES
01
Register
Page : 1 2 3
ML | Multiple Linear Regression
Gradient Descent algorithm and
05
(Backward Elimination Technique)
its variants
19, Aug 19
02
Login
06, Feb 19
Different Types of Clustering
Algorithm
06
k-nearest neighbor algorithm in
Python
09, Apr 19
15, Jan 18
03
04
Simple Genetic Algorithm (SGA)
07
ML | Mini Batch K-means
clustering algorithm
10, May 19
01, Apr 21
Facebook News Feed Algorithm
08
04, Dec 18
ML | Expectation-Maximization
Algorithm
14, May 19
Ar ticle Contributed By :
deepanshu_rustagi
@deepanshu_rustagi
Vote for difficulty
Current difficulty : Easy
Easy
Normal
Medium
Hard
Improved By :
pintoshibani8
Article Tags :
Machine Learning
https://www.geeksforgeeks.org/ml-candidate-elimination-algorithm/
Expert
▲
4/6
2022/3/24 14:42
ML - Candidate Elimination Algorithm - GeeksforGeeks
Machine Learning
Practice Tags :
Start Your Coding Journey Now!
Improve Article
Login
Register
Report Issue
Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
Load Comments
5th Floor, A-118,
Sector-136, Noida, Uttar Pradesh - 201305
feedback@geeksforgeeks.org
Company
Learn
About Us
Algorithms
Careers
Data Structures
In Media
SDE Cheat Sheet
Contact Us
Machine learning
Privacy Policy
CS Subjects
Copyright Policy
Video Tutorials
News
Languages
Top News
Python
Technology
Java
Work & Career
CPP
Business
Golang
Finance
C#
Lifestyle
https://www.geeksforgeeks.org/ml-candidate-elimination-algorithm/
▲
SQL
5/6
2022/3/24 14:42
ML - Candidate Elimination Algorithm - GeeksforGeeks
Web Development
Start Your Coding
Web TutorialsJourney Now!
Contribute
LoginWrite an Article Register
Django Tutorial
Improve an Article
HTML
Pick Topics to Write
CSS
Write Interview Experience
JavaScript
Internships
Bootstrap
Video Internship
@geeksforgeeks , Some rights reserved
▲
https://www.geeksforgeeks.org/ml-candidate-elimination-algorithm/
6/6
Download