Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this assignment is to understand the multi-class classification problem using Bayesian rule. The data is in a file called irisfile.txt which is

image text in transcribed
The purpose of this assignment is to understand the multi-class classification problem using Bayesian rule. The data is in a file called irisfile.txt which is comma separated rows. There are four attributes and a class label in each row. There are 50 samples for each of the three classes (satosa, versi-color, virginica). Read the file in python into an array for each class and split 50 rows into training set and test set. The training set consists of 20 randomly selected rows from satosa, 15 from versi-color, and 25 from virginica. The Test set consists of the remaining set. Use the training set for computing the mean and covariance matrix for each class. Use these measurements to compute the following a) Compute prior probabilities for three classes Pol), P(02), and P(w3) b) Implement functions for computing the class mean vector and covariance matrix give the data for each class (def mean(data), def covar(data)) c) Implement function for densities def pdf(x,mu,bsig) d) Implement function to compute Posterior probabilities given input vector (x) class mean (mu) and covariance matrix (bsig) and (def posterior(x,mu,bsig)) e) Using the posterior probabilities classify all the samples from test data and compute percentage classification accuracy as ... A = (N-MC)*100/N; where MC is number of misclassifications, and N is total number of samples tested. The purpose of this assignment is to understand the multi-class classification problem using Bayesian rule. The data is in a file called irisfile.txt which is comma separated rows. There are four attributes and a class label in each row. There are 50 samples for each of the three classes (satosa, versi-color, virginica). Read the file in python into an array for each class and split 50 rows into training set and test set. The training set consists of 20 randomly selected rows from satosa, 15 from versi-color, and 25 from virginica. The Test set consists of the remaining set. Use the training set for computing the mean and covariance matrix for each class. Use these measurements to compute the following a) Compute prior probabilities for three classes Pol), P(02), and P(w3) b) Implement functions for computing the class mean vector and covariance matrix give the data for each class (def mean(data), def covar(data)) c) Implement function for densities def pdf(x,mu,bsig) d) Implement function to compute Posterior probabilities given input vector (x) class mean (mu) and covariance matrix (bsig) and (def posterior(x,mu,bsig)) e) Using the posterior probabilities classify all the samples from test data and compute percentage classification accuracy as ... A = (N-MC)*100/N; where MC is number of misclassifications, and N is total number of samples tested

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books