R 中的监督学习:回归
Nina Zumel and John Mount
Win-Vector, LLC
加性关系示例:
plant_height ~ bacteria + sun
两变量对结果的同时影响不是加性的。
plant_height ~ bacteria + sun + bacteria:sun
两变量对结果的同时影响不是加性的。
plant_height ~ bacteria + sun + bacteria:sun
sun:分类 {"sun", "shade"}就像两个模型:一个用于日照,一个用于阴影。
yield ~ Stress + SO2 + O3

Metabol ~ Gastric + Sex

交互——冒号(:)
y ~ a:b
主效应与交互——星号(*)
y ~ a*b
# 两者等价
y ~ a + b + a:b
表示两个变量的乘积——I
y ~ I(a*b)
等同于 $y \propto a b$
| 公式 | RMSE(交叉验证) |
|---|---|
Metabol ~ Gastric + Sex |
1.46 |
Metabol ~ Gastric * Sex |
1.48 |
Metabol ~ Gastric + Gastric:Sex |
1.39 |
R 中的监督学习:回归