How can I test PCR model?

3 Ansichten (letzte 30 Tage)
Ezz El-din Abdullah
Ezz El-din Abdullah am 19 Jun. 2018
I'm new to modeling principle component regression. I used MATLAB documentation to see an example on how to do it using the built-in functions. I just want to know how to test the model to try other examples than the training set.
This is the piece of code I want to investigate:
[PCALoadings,PCAScores,PCAVar] = princomp(X); %,'Economy',false);
betaPCR = regress(y-mean(y), PCAScores(:,1:2));
betaPCR = PCALoadings(:,1:2)*betaPCR;
betaPCR = [mean(y) - mean(X)*betaPCR; betaPCR];
yfitPCR = [ones(n,1) X]*betaPCR;
I think X should be the X that I want to test. The question is, what is 'y' here? This y I don't know, I actually want to predict it. Thanks!

Antworten (0)

Kategorien

Mehr zu Dimensionality Reduction and Feature Extraction finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by