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 P(wi), P(2), 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 posteriorix 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 P(wi), P(2), 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 posteriorix 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_2

Step: 3

blur-text-image_3

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Describe why intercultural communication competence is a necessity

Answered: 1 week ago

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago