Assignment Task
Instructions
- You can discuss the concepts with the other students, but each student should write their own code and
- Write copious Each line should ideally have a trailing comment to explain what it does. Before each code block a text block should explain the intent of the trailing code block. Include a trailing text block to note your observations.
- Include some kind of unit testing in code blocks that do not have an output, such as those defining functions
- Max points 55, which will be scaled to approximately 8% towards course
Tasks
- Write a function to generate a data matrix Inputs: Number of samples, feature dimension. Output: Data matrix X.
- Write a function to generated dependent variable column
- Inputs: Data matrix X, weight vector for each column, bias w0, noise variance
- Output: Target vector t
- Write a function to compute a linear regression
- Input: data matrix X and weight vector w
- Output: y
- Write a function to compute the mean square error of two vectors y and
- Write a function to estimate the weights of linear regression using pseudo-inverse, assuming L2 regularization
- Input: X, t, and lambda
- Output: w, MSE, y
- Write a function to compute the gradient of MSE with respect to its weight
- Input: X matrix, t vector, and w vector
- Output: gradient vector
- Write a function to compute L2 norm of a vector w passed as a numpy Exclude bias w0.
- Write a function to compute the gradient of L2 norm with respect to the weight
- Input: X matrix and w vector
- Output: gradient vector, where gradient with respect to w0 is
- Write a function to compute L1 norm of a vector w passed as a numpy Exclude bias w0.
- Write a function to compute the gradient of L1 norm with respect to the weight
- Input: X matrix and w vector
- Output: gradient vector, where gradient with respect to w0 is
- Write a function for a single update of weights of linear regression using gradient
- Input: X, t, w, eta, lambda 2, lambda Note that the weight of MSE will be 1
- Output: updated weight and updated MSE
- Write a function to estimate the weights of linear regression using gradient
- Inputs: X, t, lambda2 (default 0), lambda1 (default 0), eta, max_iter, min_change_NRMSE
- Output: Final w, final RMSE normalized with respect to variance of
- Stopping criteria: Either max_iter has been reached, or the normalized RMSE does not change by more than min_change_NRMSE
- Run multiple experiments (with different random seeds) for, plot the results of (box plots), and comment on the trends and potential reasons for the following relations:
- Training and validation NRMSE obtained using pseudo inverse with number of training samples
- Training and validation NRMSE obtained using pseudo inverse with number of variables
- Training and validation NRMSE obtained using pseudo inverse with noise variance
- Training and validation NRMSE obtained using pseudo inverse with w0
- Training and validation NRMSE obtained using pseudo inverse with lambda2
- Time taken to solve pseudo inverse with number of samples and number of variables and its breaking points
- Training and validation NRMSE obtained using gradient descent with max_iter
- Training and validation NRMSE obtained using gradient descent with eta
- Time taken to solve gradient descent with number of samples and number of variables and its breaking points
- Time taken to solve gradient descent with number of variables and its breaking point
- Training and validation NRMSE and number of nearly zero weights obtained using gradient descent with lambda2
- Training and validation NRMSE and number of nearly zero weights obtained using gradient descent with lambda1
- Training and validation NRMSE for optimal lambda2 with noise variance
- Training and validation NRMSE for optimal lambda1 with noise variance
- Experiment (f) but, this time with number of training samples and number of variables
- Write your overall learning points by doing entire [4 + 2 bonus for diligent work and critical thinking]
- Quote your references, including roll numbers of fellow students with whom you Be specific about which part was inspired by what source or which friend.
This Engineering have been solved by our PhD Experts at My Uni Paper. Our Assignment Writing Experts are efficient in providing a fresh solution to this question. We are serving more than 10000+ Students in Australia, the UK, and the US by helping them to score HD in their academics. Our Experts are well-trained to follow all marking rubrics and referencing styles.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.