CSCI 6515 Assignment 4– Probabilistic regression and classification, Generative Models, and Bayes Nets. SOLVED

$35.00

Category: Tags: , , , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (3 votes)

1. [70 marks] This Assignment requires you to write a Python script file called sol1.py to load the iris dataset
from the first assignment and apply EM with a Gaussian mixture model on IRIS data. You are not allowed to
use any Python public libraries like sklearn and scipy. You might compare the results of your program with
sklearn models, but the whole exercise is to write the algorithm yourself.
1.1. [70 marks, 35 marks for Grads] Write a program to implement EM with a Gaussian mixture model on
the iris dataset and plot the Sepal data points based on the obtained clusters. Try different number of
classes (k=2,3,4). Hint: use numpy.linalg.pinv and also use numpy.copy to temporary save a
vector. You might plot the points using the obtained RGB colour values (i.e. if you have three clusters,
there are three probability estimates of a data point belonging to each class).
1.2. Graduate students only [20 marks] Evaluate the prediction quality with different number of assumed
classes (k=2,3,4). Explain briefly your evaluation method (maximum half a page).
2. [30 marks, 15 marks for Grads] This Assignment requires you to write a Python script file called sol2.py to
calculate some inference of a simplified version of the Car repair example from the manuscript. Given is are
the following probabilities:
The marginal probability that the alternator is broken is 1/1000 and the marginal probability that the fan belt
is broken is 2/100. The probability that the battery is charging when either the alternator or the fan belt is
broken is zero. However, even if both are working there is a 5/1000 probability that the battery is not
charging. When the battery is not charging then there is a 90% chance that the battery is flat, though even if
the battery is charging then there is a 10% chance that the battery is flat. Finally, the car does not start if either
the battery is flat, or there is no gas, or the starter is broken. However. Even if these three conditions don’t
hold there is a 5% chance that the car won’t start.
2.1. Draw the causal model of this system.
2.2. What is the probability that the alternator is broken given that the car won’t start?
2.3. What is the probability that the fan belt is broken given that the car won’t start?
2.4. What is the probability that the fan belt is broken given that the car won’t start and the alternator is
broken?
2.5. What is the probability that the alternator and the fan belt is broken given that the car won’t start?
Hint: You might use lea.Lea methods.
3. Grads, only [30 marks] Naïve Bayes:
This Assignment requires you to write a Python script file called sol3.py to test the Naïve Bayes on the
20newsgroups dataset. Similar to the second question of assignment 2, you should read the data and work
with sparse data in python. You should then write a Naïve Bayes program on your own (not using library
function) to implement the binomial version of the Naïve Bayes rule outlined in the manuscript. Please
provide the results in form of a confusion matrix.