Question
In the lectures and Prac 2 we have considered parametric probabilistic classification for a binary (2-class) problem with one-dimensional input data. This can be extended
In the lectures and Prac 2 we have considered parametric probabilistic classification for a binary (2-class) problem with one-dimensional input data. This can be extended to the case where we have more classes. Write a function (e.g. in Matlab or python) that takes 4 inputs: A n 2 set of (training) input data. Where the first column is a one-dimensional set of data, and the second column is the class, ranging from 0 to k-1, k, the number of classes, x, an test input to classify, and p, the k-dimensional class prior probability vector satisfying P k1 i=0 p i = 1. Your function should return the posterior probabilities for each class for the given x-value. Using your function, plot a labelled posterior graph similar to that produced in Prac 2, where the horizontal axis represents the value of x and the vertical axis represents the posterior probabilities for each of the k classes. Use the data provided in iris.csv, taking the first column as x and the last column as the class label. Assume an equal class prior probability. For this question, submit your plot and a listing of your code. You can also include command line output demonstrating usage of the code. Marking is primarily about the output of the code rather than the design.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started