Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Question 2: [File: decision_tree_2.py] Complete the Python program (decision_tree_2.py) that will read the files contact_lens_training_1.csv, contact_lens_training_2.csv, and contact_lens_training_3.csv. Each training set has a different number of instances (10, 100, 1000 samples). You will observe that the trees are being created by setting the parameter max_depth = 5, which is used to define the maximum depth of the tree (pre-pruning strategy) in sklearn. Your goal is to train, test, and output the performance of the 3 models created by using each training set on the test set provided (contact_lens_test.csv). You must repeat this process 10 times (train and test using a different training set), choosing the average accuracy as the final classification performance of each model.

Question 3e: [File: knn.py] Complete the Python program (knn.py) to read the file email_classification.csv and compute the LOO-CV error rate for a 1NN classifier on the spam/ham classification task. The dataset consists of email samples, where each sample includes the counts of 20 specific words (e.g., “agenda” or “prize”) representing their frequency of occurrence

Question 5b: [File: naive_bayes_2.py] Complete the Python program (naïve_bayes.py) that will read the file weather_training.csv (training set) and output the classification of each of the 10 instances from the file weather_test (test set) if the classification confidence is >= 0.75.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages