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 Center および File ExchangeAnalysis 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