100% Guaranteed Results


CS305 – Week 7 – Adaboost Solved
$ 24.99
Category:

Description

5/5 – (1 vote)

MACHINE INTELLIGENCE LABORATORY- PESU UE19CS305
Teaching Assistantsvighneshkamath43@gmail.com sarasharish2000@gmail.com abaksy@gmail.com
An ensemble method is a technique that combines the predictions from multiple machine learning algorithms together .To make more accurate predictions than any individual model. One such algorithm is Adaboost.
In week 7 you are required to code for the class AdaBoost which will implement Adaboost algorithm.
Your task is to complete the code for the class AdaBoost and its methods
You are provided with the following files:
1. Week7.py
2. SampleTest.py
Note: These sample test cases are just for your reference.
SAMPLE TEST CASE Data
This is a randomly generated test case and can be analyzed by opening sampleTest.py
Important Points:
1. Please do not make changes to the function definitions that are provided to you. Use the skeleton as it has been given. Also do not make changes to the sample test file provided to you. Run it as it is.
2. You are free to write any helper functions that can be called in any of these predefined functions given to you. Helper functions must be only in the file named ‘YOUR_SRN.py’.
3. Your code will be auto evaluated by our testing script and our dataset and test cases will not be revealed. Please ensure you take care of all edge cases!
6. Hidden test cases will not be revealed post evaluation.
week4 .py
 You are provided with structure of class AdaBoost.
 The class AdaBoost contains one constructor and 6 methods out of which two is already written.  Your task is to write code for the four of these 6 methods.
 Do not make any changes to the already written methods
 def __init__(self, n_stumps=20)
 This initialises a number of decision stumps that you will be using and a an empty list to store these stumps
 def fit(self, X, y)
 This is fit function that will be finally called to train the adaboost algorithm
 This creates Decision Tree Classifier with given parameter appends it to the stump list
 This also calls the method stump_error,compute_alpha,update_weights which you are required to implement further
 def stump_error(self, y, y_pred, sample_weights)
 def compute_alpha(self, error)
 The functions takes the error of the decision stump and computes the value alpha, that is the weight the stump has in the final prediction.
 Use numerical stability of 1e-9 so that you don’t get zero division error.
 def update_weights(self, y, y_pred, sample_weights, alpha)
 The function takes the true output and prediction along with the sample weight ans alpha value  Returns the updates sample weights which is normalized.
 def predict(self, X)
 Predict the output of sample input X using the Adaboost model
USE THE BELOW MENTIONED FORMULA TO UPDATE WEIGHTS AND ALPHA

2. You can import libraries that come built-in with python 3.7
3. You cannot change the skeleton of the code
4. Note that the target value is an int
SampleTest.py
1. This will help you check your code.
2. Make sure you have installed numpy and sklearn
3. Passing the cases in this does not ensure full marks, you will need to take care of edge cases
4. Name your code file as YOUR_SRN.py
You are required to complete code in week4.py and rename it to SRN.py
Failing to submit in the right format will lead to zero marks without a chance for correction Example: If your SRN is PES1201801819 your file should be PES1201801819.py
• Delete all print statements if used for debugging before submission
• Ensure you run your file against sample test before submitting
• Check for syntax and indentation errors in your file, and make sure that tabs and spaces are used uniformly for indentation (i.e., if tabs are used then only tabs must be used throughout the file, and similarly for spaces)
• All the helper functions should be in the same file (SRN.py), make sure you run the sample test cases as indicated above before submitting.
Where to submit: Edmodo

Reviews

There are no reviews yet.

Be the first to review “CS305 – Week 7 – Adaboost Solved”

Your email address will not be published. Required fields are marked *

Related products