Bella Ciao Bella Ciao Bella Ciao

 

Schematics 

65%dutyCycle

50%dutyCycle

Harleyoscillator


18ECL58


DBMS


T shilpa 

Manual_ECE


  cn manual 

14 pages code


madd

visiting

calci

login&signup

wall paper

FS LAB

St

MAD AIML

ML

ML 1b

import pandas as pd


data = pd.read_csv("1weather_dataset.csv")


def package_hypothesis(hypothesis, outcome):

    ln = dict()

    ln['hypothesis'] = hypothesis

    ln['outcome'] = outcome

    return ln


#Test hypothesises

h1 = package_hypothesis(["?","?","normal","?","?"],"yes")

h2 = package_hypothesis(["sunny","?","high","?","?"],"yes")

h3 = package_hypothesis(["rainy","?","high","?","?"],"no")

h4 = package_hypothesis(["sunny","warm","high","?","?"],"yes")

h5 = package_hypothesis(["?","cold","?","cool","?"],"no")

h6 = package_hypothesis(["?","?","?","cool","?"],"yes")


def compare(values, hypo):

    for i in range(len(values)):

        if(hypo[i] != "?"):

            if(values[i] != hypo[i]):

                return False

    return True


def list_then_eliminate(data, *hypothesis):

    consistent_space = []

    inconsistent_space = []

    

    for hyp in hypothesis:

        state = True

        for i in range(data.shape[0]):          

            if(hyp['outcome'] == data.iloc[i,-1]):

                if(not compare(data.iloc[i,:-1][:-1],hyp['hypothesis'])):

                    inconsistent_space.append(hyp)

                    state = False

                    break

        if(state):

            consistent_space.append(hyp)

            

    return (inconsistent_space, consistent_space)


for i in list_then_eliminate(data, h1,h2,h3,h4,h5,h6):

    print(i)

DIP

ARM LAB

Comments

Popular posts from this blog

PLAY INDIAN RUMMY GAME AND EARN MONEY

BENEFITS OF PLAYING CASH RUMMY