Documente Academic
Documente Profesional
Documente Cultură
Implement and demonstrate the FIND-S algorithm for finding the most specific
hypothesis based on a given set of training data samples. Read the training data
from a .CSV file.
import csv
attributes = [ ['Sunny', 'Cloudy', 'Rainy'],
['Warm', 'Cold'],
['Normal', 'High'],
['Strong', 'Weak'],
['Warm', 'Cool'],
['Same', 'Change']]
total_attributes = len(attributes)
print("\nTotal number of attributes is: ", total_attributes)
print ("The most specific hypothesis: ['0','0','0','0','0','0']")
print ("The most general hypothesis: ['?','?','?','?','?','?']")
a=[]
print("\nThe Given Training Data Set is:")
with open('T:\\ML\\datasheet\\EnjoySport.csv', 'r') as cfile:
for row in csv.reader(cfile):
a.append(row)
print(row)
Output: