﻿ 加拿大数学作业代写 ECE 6254代写 - 作业代写, 数学代写

# 加拿大数学作业代写 ECE 6254代写

2022-09-23 10:16 星期五 所属： 作业代写 浏览：266 ## ECE 6254 Spring 2019

### Problem Set 3

Problem 1

I split the first 400 obsevations as the training set and the rest is the test set.For the standardization, firstly I calculated the mean and standard deviation of each feature on the training set, then I standardized the training set and test set by taking each feature, subtracting off the mean and deviding by the standard deviation, which are calculated previously on the training set.

(a)Themean-squared error for least square on the test set is 89377.  加拿大数学作业代写

(b)I found the best λ by 5-fold Cross Validation: divide the training data into 5 parts with the same size oftraining size , at each iteration of 5-fold CV, select one part as validation set, then train the model on the rest 4 parts of the training set, and evaluate the model on the validation set, the chosen value of λ is that performs best on the validation set.

I took 5-fold CV to find the best λ among 0.01,0.1,1,10,100,1000. The best λ selected by 5-fold CV is 100.

The MSE for rigde regression with λ = 100 on the test set is 24.81635.

(c)Itook 5-fold CV as in part (b) to find the best best alpha among 01,0.1,1,10,100,1000. And the best alpha is 0.1.

The MSE for LASSO with the best alpha on the test set is 34.12477. The number of of non zeros components in θ is 10.

### Problem3

I use the 5-fold cross validation as in Problem 1(b) to find the proper parameters.

(a)Thebest λ among 01,0.1,1,10,100,1000 is 10. The slope my linear fit is 0.14005, the intercept my linear fit is 0.35982.

(b)The value of ϵ was selected among 1.1,1.2,1.35,1.5,2,5,10, and α was selected among 0.001,0.01,0.1,1,10,100. The best ϵ is 1.1, the best α is 10. The slope is 0.29021, the intercept is26441.

(c)The value of C was selected among 0.01,0.1,1,10,100, and ϵ was selected among 0.001,0.01,0.1,1,10,100. The best C is 0.1, the best ϵ is 0.01. The slope is 0.26449, the intercept is28733.

### Problem4加拿大数学作业代写  