Table of Contents

Assignment: Maximum Likelihood

📅 Deadline: 1.1.2025 21:59

🏦 Points: 4

Task Description

In this assignment, you are tasked with implementing a maximum-likelihood estimator for a Gaussian mixture model, computing the plugin Bayes classifier and estimating the conditional risk of the prediction. You can find the complete description of the assignment in the Assignment PDF.

You are provided with a template containing the following files:

Your objective is to implement the function MLE_parameters, which estimates the parameters of the Gaussian mixture, and the function bayes_classifier which implements the plugin-bayes classifier. Both functions can be found in main.py.

All python files must be stored in the root of the .zip sent for submission.

How to Test

After completing your implementation, you can test your solution using the following commands before submitting it to BRUTE:


Test Case 1
python main.py test-cases/public/instances/instance_1.json --plot

Expected output:

Visualizing Gaussian Mixture ...

Maximum Likelihood Estimate:
  class_priors: Test OK
  class_centroids: Test OK
  shared_covariance_matrix: Test OK
  
Bayes Classifier:
  predictions: Test OK
  risks: Test OK
  
Visualizing Conditional Risk ...

Test Case 2
python main.py test-cases/public/instances/instance_2.json --plot

Expected output:

Visualizing Gaussian Mixture ...

Maximum Likelihood Estimate:
  class_priors: Test OK
  class_centroids: Test OK
  shared_covariance_matrix: Test OK
  
Bayes Classifier:
  predictions: Test OK
  risks: Test OK
  
Visualizing Conditional Risk ...

Test Case 3
python main.py test-cases/public/instances/instance_3.json

Expected output:

Maximum Likelihood Estimate:
  class_priors: Test OK
  class_centroids: Test OK
  shared_covariance_matrix: Test OK
  
Bayes Classifier:
  predictions: Test OK
  risks: Test OK
Note that this test case is not 2 dimensional. Therefore, we do not visualize it.

Submission Guidelines