Skip to content
View amritjha27's full-sized avatar

Block or report amritjha27

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
amritjha27/README.md

/usr/bin/env python

coding: utf-8

In[2]:

import numpy as np import pandas as pd data=pd.DataFrame(data=pd.read_csv('D:/AIML Lab(2022-23)/enjoysport.csv')) print(data) concepts=np.array(data.iloc[:,0:-1]) print(concepts) target=np.array(data.iloc[:,-1]) print(target) def learn(concepts,target): specific_h=concepts[0].copy() print("initialization of specific_h and general_h") print(specific_h) general_h=[["?" for i in range(len(specific_h))] for i in range(len(specific_h))] print(general_h)

for i,h in enumerate(concepts):
    if target[i]=="yes":
        for x in range(len(specific_h)):
            if h[x]!=specific_h[x]:
                specific_h[x]='?'
                general_h[x][x]='?'
                    
    if target[i]=="no":
        for x in range(len(specific_h)):
            if h[x]!=specific_h[x]:
                general_h[x][x]=specific_h[x]
            else:
                general_h[x][x]='?'
                
    print("steps of candidate Elimination Algorithm",i+1)
    print(specific_h)
    print(general_h)
    
indices=[i for i,val in enumerate(general_h)if val==['?','?','?','?','?','?']]
for i in indices:
    general_h.remove(['?','?','?','?','?','?'])
return specific_h,general_h

s_final,g_final=learn(concepts,target) print("\nFinal Specific_h:",s_final,sep="\n") print("/nFinal General_h:",g_final,sep="\n")

In[ ]:

In[ ]:

Popular repositories Loading

  1. terra terra Public

    CSS

  2. student-database-management-system student-database-management-system Public

    Built using HTML, CSS, JAVA, PHP, SQL. It’s an ERP for teachers to keep track of student details.. The admin can add a student, add a department, add attendance, edit and delete student records.

    CSS

  3. fabcare fabcare Public

    Built using Java An app especially designed to manage our daily laundry.

    Java

  4. department-of-ISE department-of-ISE Public

    HTML

  5. isedept.github.io isedept.github.io Public

    HTML

  6. deptweb deptweb Public

    HTML