Question: 3. Use R or Python to work on this problem. Simulate 1000 data points from the following nonlinear model. y = 10sin(x1x2) +20 (x3


3. Use R or Python to work on this problem. Simulate 1000

3. Use R or Python to work on this problem. Simulate 1000 data points from the following nonlinear model. y = 10sin(x1x2) +20 (x3 -0.5)+10x4+5x5 +N(0,0 = 25) 2 where x1,..., 5 Uni[0, 1] random variables. i Partition the simulated data set into two parts. Use 80% of the data for training and allocate the rest for testing. ii Now, train a K-nearest neigbour regression model using different K = {5,7,9, 11, 13, 15, 17.19, 21}. Make sure to standardize your 1,.., 5 values before the training the KNN mod- els. iii Evaluate the model performace using Root Mean Squared Error (RMSE) and the Mean Absolute Error (MAE). What is the optimal K value to be used? Comment on your findings.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!