How do you format the function 'pcrsse' required for crossval?

5 次查看(过去 30 天)
Hi,
I am working through the example "Partial Least Squares Regression and Principal Components Regression" provided in the Mathworks Help Center. I have reached the part discussing cross validation as a method to determine the necessary number of principle components.
The instructions say it is necessary to calculate the mean squared prediction error (MSEP) for the principle component regression (PCR) using the function 'crossval.' In order to do this, you must make a function to determine the sum of squared error for PCR, but they do not give the code for this function only the name 'pcrsse.' However, inserting a function into crossval requires tricky formatting, I have also tried to follow the help file on 'crossval' with no success. Will someone please look at this example in the Help Center and help me develop this 'pcrsse' function? Many thanks.
Frederik
  2 个评论
Asvin Kumar
Asvin Kumar 2020-6-9
Can you provide details on what you've tried so far and what issues you ran into while following the help file on crossval?
Frederik Schmidt
Frederik Schmidt 2020-6-10
Thanks for your willingness to help, but actually the problem has already been resolved. I only had to enter a larger amount of data for the 10-fold cross-validation to work. And obviously the function '@pcrsse' is provided by Matlab and automatically called when requested in the function call.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Gaussian Process Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by