Warning
This page is located in archive.

Assignment: Confidence Interval

📅 Deadline: 6.11.2024 21:59

🏦 Points: 2

Task Description

In this assignment, you are tasked with computing a confidence interval using the Hoeffding inequality. You can find the complete description of the assignment in the Assignment PDF.

You are provided with a template containing the following files:

  • main.py: This file includes the function confidence_interval that you are required to implement. It loads the input, verifies the correctness of the confidence_interval output, and writes the results to a file readable by the BRUTE system.
  • utils.py: Contains helper functions for loading and saving data. You do not need to modify this file.
  • test-cases: A folder containing public test cases to help you verify your implementation before submitting to BRUTE.

Your objective is to implement the function confidence_interval in main.py.

Make sure that all the python files are stored in the root of the .zip sent for submission.
Note that the lower bound computed using the Hoeffding inequality may be negative, while loss functions typically return non-negative values. It is good practice to clamp the lower bound to 0, but solutions that return the value directly from the Hoeffding inequality without clamping are also accepted by BRUTE.

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

Expected output:

The true risk is in the interval [-0.30, 0.30] with probability atleast 0.95
Comparing with reference solution
Test OK

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

Expected output:

The true risk is in the interval [-0.61, 0.61] with probability atleast 0.95
Comparing with reference solution
Test OK

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

Expected output:

The true risk is in the interval [0.13, 0.37] with probability atleast 0.9
Comparing with reference solution
Test OK

Test Case 4
python main.py test-cases/public/instances/instance_4.json

Expected output:

The true risk is in the interval [-0.23, 0.75] with probability atleast 0.9
Comparing with reference solution
Test OK

Test Case 5
python main.py test-cases/public/instances/instance_5.json

Expected output:

The true risk is in the interval [0.06, 0.07] with probability atleast 0.95
Comparing with reference solution
Test OK

Test Case 6
python main.py test-cases/public/instances/instance_6.json

Expected output:

The true risk is in the interval [0.74, 0.82] with probability atleast 0.95
Comparing with reference solution
Test OK

Submission Guidelines

  • Submit the completed code as a .zip via BRUTE.
  • Make sure your implementation passes the test cases provided above. Good luck! 😊
courses/be4m33ssu/homeworks/hw_confidence_interval.txt · Last modified: 2024/11/05 15:12 by paplhjak