Skip to main content

Posts

Showing posts from 2021
import  csv with   open ( '/content/drive/MyDrive/ML lab programs/Lab 1 Find-S algorithm/weather.csv' )  as  f:   reader = csv.reader(f)   data = list(reader)  print ( 'Training data' ) for  row  in  data:    print (row) attr_len= len (data[ 0 ]) -1 h = [ '0' ]*attr_len       print ( 'The Hypothesis are' ) for  row  in  data:    if  row[ -1 ] ==  'Yes' :     j =  0      for  col  in  row:         if  col !=  'Yes' :           if  col != h[j]  and  h[j] ==  '0' :           h[j] = col         ...