Finds Algorithm in Machine Learning

Kapil Bhise
Analytics Vidhya
Published in
2 min readMar 3, 2021

--

Hi guys, in this article I will implement and demonstrate the FIND-S algorithm for finding the most specific hypothesis based on a given set of training data samples.

In finds algorithm , we initialize hypothesis as an array of phi, thein in the first step we replace it with the first positive row of our dataset which is most specific hypothesis.

In next step, we will traverse the dataset and check if the target value of dataset is positive or not, we will only consider positive value. if the value is positive we will traverse that row from start to end and check if any element matches with our respective hypothesis. if the element does not matches with the hypothesis, we will generalize the hypothesis and we will replace element in hypothesis with the dataset element .

Discussion of algorithm :

  1. FIND-S Algorithm starts from the most specific hypothesis and generalizes it by considering only positive examples.
  2. FIND-S algorithm ignores negative examples. – As long as the hypothesis space contains a hypothesis that describes the true target concept, and the training data contains no errors, ignoring negative examples does not cause any problem.
  3. FIND-S algorithm finds the most specific hypothesis within H that is consistent with the positive training examples. – The final hypothesis will also be consistent with negative examples if the correct target concept is in H, and the training examples are correct.

Pseudo code of algorithm :

Below is the code how we will implement finds algorithm,

from above we can conclude that,

  1. We find that there is no way to determine if the only final hypothesis is consistent with data or there are more hypotheses that are consistent with data.
  2. As it ignores the negative samples , inconsistent data sets can produce wrong hypotheses.

To overcome the problem we are facing because of using only positive instances we use candidate elimination algorithm where we consider negative instances also.

Thank you!

--

--

Kapil Bhise
Analytics Vidhya

Passionate about learning new technologies and implementing them. Enjoy contributing ideas to projects. Strong written and verbal communication skills;