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