16 November 2021 3 959 Report

I am working on a data mining project. The goal of this project is to implement an ID3 classifier and Naive Bayes Classifer.

I have to sets of data for ID3 the following test sets are provided

A2 training set

```

Venue,color,Model,Category,Location,Weight,Variety,Material,Volume 2,6,4,4,4,2.75,2,1.1,1 1,2,4,4,4,1.5,6,2.23,6 1,5,4,4,4,1.5,2,1.1,6 2,4,4,4,4,2.75,6,1.1,4 1,4,4,4,4,1.5,2,2.23,2 2,4,3,3,3,2.75,1,1.1,1 1,5,2,1,4,1.5,6,2.23,6 1,2,3,3,3,1.5,2,1.1,6 2,6,4,4,4,2.75,3,1.1,1 1,4,4,4,4,1.5,2,1.1,6 1,5,4,4,4,1.5,2,1.1,4 1,4,5,5,5,1.5,6,2.23,4 2,5,4,4,4,2.75,3,1.1,1 1,5,5,5,5,1.5,6,2.23,5 2,6,5,5,5,2.75,2,1.1,4 1,2,3,3,3,1.5,3,2.23,6 2,4,4,4,4,2.75,4,1.1,1 1,4,4,4,4,1.5,1,3.94,6 2,4,3,3,3,2.75,6,2.23,1 1,4,4,4,4,1.5,2,2.23,6 1,4,4,4,4,1.5,6,1.1,6 1,5,3,3,3,1.5,6,1.1,6 2,4,4,4,4,2.75,1,1.1,1 1,4,4,4,4,1.5,6,2.23,6 2,4,3,3,3,2.75,1,1.1,6 2,5,4,4,4,2.75,3,1.1,6 1,5,5,5,5,1.5,6,3.94,6 2,5,3,3,3,2.75,1,1.1,1 1,5,5,5,5,1.5,6,1.1,2 1,5,4,4,4,1.5,3,3.94,2 2,3,3,3,3,2.75,5,4.25,2 2,6,4,4,4,2.75,1,4.25,1 2,5,3,3,3,2.75,1,1.1,1 2,5,3,3,3,2.75,1,1.1,1 2,4,3,3,3,2.75,3,1.1,1 2,6,4,4,4,2.75,2,1.1,1 1,3,3,3,3,1.5,5,2.23,6 2,3,3,3,3,2.75,6,1.1,4 2,3,3,3,3,2.75,1,1.1,1 2,4,3,3,3,2.75,2,1.1,1 2,5,5,5,5,2.75,6,2.23,2 2,4,4,4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,5,2.23,6 1,2,2,3,3,1.5,5,2.23,2 2,2,2,3,3,2.75,3,1.1,6 2,2,2,3,3,2.75,4,1.1,2 2,2,2,3,3,2.75,4,2.23,1 2,2,2,3,3,2.75,2,2.23,4 2,3,2,3,3,2.75,4,2.23,5 1,2,2,3,3,1.5,4,2.23,5 2,2,1,3,3,2.75,5,1.1,3 2,2,4,3,3,2.75,6,1.1,6 1,2,4,3,3,1.5,3,2.23,6 1,3,2,1,4,1.5,6,2.23,4 2,3,5,5,5,2.75,5,1.1,4 1,2,1,3,3,1.5,6,3.94,2 1,2,1,3,3,1.5,5,2.23,2 1,2,1,3,3,1.5,6,3.94,2 2,2,1,3,3,2.75,6,3.94,3 1,2,1,3,3,1.5,6,3.94,6 1,2,3,3,3,1.5,2,2.23,6 2,2,3,3,3,2.75,6,3.94,6 2,2,3,3,3,2.75,3,3.94,2 1,2,4,4,4,1.5,6,3.94,6 2,2,2,3,3,2.75,5,3.94,5 1,2,2,3,3,1.5,4,2.23,6 1,1,3,3,3,1.5,3,2.23,5 1,1,2,2,2,1.5,4,2.23,6 2,4,4,4,4,2.75,3,3.94,4 1,2,3,3,1,1.5,3,4.25,2 1,2,3,3,1,1.5,5,4.25,4 1,2,3,3,1,1.5,6,2.23,1 1,2,3,3,1,1.5,6,1.1,6 1,2,3,3,1,1.5,3,2.23,6 1,2,4,4,4,1.5,4,3.94,6 2,2,3,3,1,2.75,2,2.23,2 2,2,4,4,4,2.75,3,1.1,1 2,2,3,3,3,2.75,2,2.23,2 2,2,1,3,1,2.75,6,3.94,2 1,2,1,3,1,1.5,4,2.23,2 1,2,1,3,1,1.5,6,2.23,4 1,2,2,4,1,1.5,6,2.23,4 1,2,3,3,1,1.5,4,3.94,2 1,2,3,3,2,1.5,3,3.94,4 1,2,2,4,4,1.5,6,3.94,2 2,3,1,3,3,1.5,4,3.94,4 2,2,1,3,3,1.5,2,2.23,6

```

A2 test set

```

Venue,color,Model,Category,Location,Weight,Variety,Material,Volume 1,6,4,4,4,1.5,1,1.1,6 2,5,4,4,4,2.75,6,1.1,1 1,6,2,1,4,1.5,4,2.23,4 1,6,2,1,4,1.5,2,1.1,2 2,6,5,5,5,2.75,2,1.1,2 1,5,4,4,4,1.5,6,2.23,2 1,3,3,3,3,1.5,6,2.23,2 1,5,2,1,1,1.5,2,1.1,2 1,4,4,4,1,1.5,5,3.94,6 1,4,4,4,4,1.5,6,4.25,6 2,5,4,4,4,2.75,4,4.25,1 2,4,3,3,3,2.75,1,1.1,1 2,6,5,5,5,1.5,4,2.23,1 1,4,4,4,4,1.5,6,1.1,6 1,4,3,3,3,1.5,1,3.94,6 2,4,4,4,1,2.75,2,3.94,1 1,3,4,4,4,1.5,4,3.94,6 1,4,3,3,3,1.5,6,3.94,6 1,4,3,3,3,1.5,6,1.1,2 2,5,4,4,1,2.75,3,1.1,1 2,4,4,4,4,2.75,1,2.23,1 2,4,4,4,1,2.75,3,2.23,1 1,3,3,3,3,1.5,1,2.23,6 2,5,5,5,5,2.75,3,1.1,4 2,4,5,5,1,2.75,2,1.1,4 1,4,4,4,4,1.5,2,2.23,6 2,5,4,4,4,1.5,2,1.1,1 2,5,4,4,2,2.75,4,1.1,1 1,3,3,3,3,1.5,4,2.23,6 1,4,4,4,4,1.5,6,1.1,6 1,4,3,3,3,1.5,6,2.23,6 1,5,5,5,5,1.5,2,3.94,6 2,2,2,2,2,2.75,6,3.94,6 2,3,3,3,3,2.75,4,3.94,3 2,2,2,2,2,2.75,6,3.94,3 1,1,1,3,3,1.5,6,2.23,3 2,3,1,3,3,2.75,6,2.23,4 2,2,1,3,3,2.75,6,2.23,3 2,3,3,3,3,2.75,4,1.1,5 2,2,4,4,4,2.75,3,1.1,3 1,4,1,3,3,1.5,6,2.23,5 1,4,1,3,3,1.5,6,2.23,5 2,6,1,5,4,2.75,6,3.94,6

```

I don't know how to get started in this since the data is complex. I am familiar with decision trees, but it has been some time since I last implemented the algorithm .

I need to use the training set shown above to extract rules and test them against the test set. Any help with this would be greatly appreciated.

Program outline:

```

# prompt user to select either ID3 or Bayes classifier. # use the training set to predict the test set. # use the Assignment 2--Training set to extract rules and test the quality of the extracted rules against the Assignment 2-- Test set for ID3. # leaf generated from the decision tree. F1 = 0 # define c1 count of records w/ dominant class in F1 # How do I determine the number of records w/ dominant class in F1? c1 = 0 # alpha = c1/ |F1| # F1 is one of the unique values of a given attribute. alpha = c1/ abs(F1) # the number of records in the test set that are correctly classified by the rules extracted from the tree before removal. # How do I determine the number of records in test set that are correctly classified by rules extracted from the tree before removal? N = 0 # the number of records in the test set that are correctly classified by the rules extracted from the tree. # How do I determine the number of records in the test set that are correctly classified by the rules extracted from the tree? M = 0 # the parameter and 0

More Evan Gertis's questions See All
Similar questions and discussions