Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in python without using sklearn, only using pandas, numpy and matplotlib You need to use 5-fold cross-validation to pick out the best

I need help in python without using sklearn, only using pandas, numpy and matplotlib

You need to use 5-fold cross-validation to pick out the best model for the prediction. You should present a chart of the error function J, similar to the one in the lecture (see below). You may need to use a package like "tabulate" to print out the table.

Ex.

Linear Quadratic Cubic Fourth

----------------- -------- ----------- ------- --------

1234 10.25 24.25 12.25 23.25

5 10.25 19.25 14.25 23.25

1235 10.25 15.25 19.25 23.25

4 10.25 10.25 20.25 23.25

1245 10.25 24.25 12.25 23.25

3 10.25 19.25 14.25 23.25

1345 10.25 24.25 12.25 23.25

2 10.25 19.25 14.25 23.25

2345 10.25 24.25 12.25 23.25

1 10.25 19.25 14.25 23.25

Mean for Training 0 0 0 0

Mean for Testing 0 0 0 0

You need to plot your training and testing J with respect to the polynomial degree, similar to the one in the lecture.

######################################################################

# TODO: 5-fold cross-validation #

######################################################################

pass

######################################################################

# END OF YOUR CODE #

######################################################################

######################################################################

# TODO: Print out the table chart #

######################################################################

pass

######################################################################

# END OF YOUR CODE #

######################################################################

######################################################################

# TODO: Plot the J curve #

######################################################################

pass

######################################################################

# END OF YOUR CODE #

######################################################################

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Determine whether the graph is that of a function. X VK

Answered: 1 week ago