Warning
This page is located in archive.

Assignment: Generalization Bound

📅 Deadline: 13.11.2024 21:59

🏦 Points: 2

Task Description

In this assignment, you are tasked with computing a generalization bound for a learning algorithm that operates within a finite hypothesis space. 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 generalization_bound that you are required to implement. It loads the input, verifies the correctness of the generalization_bound 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 generalization_bound 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

Expected output:

Given that we selected the predictor from a hypothesis space of 216 predictors,
the true risk of the predictor is smaller than [0.36] with probability at least 0.95

Comparing with reference solution
Test OK

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

Expected output:

Given that we selected the predictor from a hypothesis space of 54 predictors,
the true risk of the predictor is smaller than [0.30] with probability at least 0.98

Comparing with reference solution
Test OK

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

Expected output:

Given that we selected the predictor from a hypothesis space of 54 predictors,
the true risk of the predictor is smaller than [0.28] with probability at least 0.88

Comparing with reference solution
Test OK

Submission Guidelines

  • Submit the completed code as a .zip via BRUTE.
  • All python files must be stored in the root of the .zip sent for submission.
  • Make sure your implementation passes the test cases provided above. Good luck! 😊
courses/be4m33ssu/homeworks/hw_generalization_bound.txt · Last modified: 2024/10/14 14:44 by paplhjak