cross-validate fitlm

조회 수: 3 (최근 30일)
Toby Feld
Toby Feld 2021년 5월 8일
Hello,
I would like to use fitlm to also take non-linear relationships into account.
I have X1 which is a 100 x 3 matrix, predictive variables (for training). X2 is a 50 x 3 matrix, predictive variables (for testing). I have Y1 which is a 100 x 1 matrix, predicted variable (for training). Y2 is a 50 x 1 matrix, predicted variable (for testing).
lm = fitlm(X1,Y1,'quadratic');
This gives me a very complex variable, a "1x1 linear model".
Now how can I use the model lm to cross-validate? I can see that there are estimated coefficients, but there are also coefficients for interactions (e.g., "x1:x2"). I am not sure how to do this, but I want something like "testlm(X2,Y2,'quadratic')".
Thanks,
Tim

답변 (0개)

카테고리

Help CenterFile Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by