Question: 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.

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

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 #

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

\begin{tabular}{lrrrr} & Linear & Quadratic & Cubic & Fourth \\ \hline 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 \end{tabular}

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 Databases Questions!