Überwachtes Lernen in R: Regression
Nina Zumel and John Mount
Win-Vector, LLC
$$ y \sim b0 + s1(x1) + s2(x2) + .... $$

gam(formula, family, data)
family:
Am besten für größere Datensätze
anx ~ s(hassles)
s() kennzeichnet eine nichtlineare Variables() bei stetigen Variablen
| Modell | RMSE (Cross-Validation) | $R^2$ (Training) |
|---|---|---|
| Linear ($hassles$) | 7.69 | 0.53 |
| Quadratisch ($hassles^2$) | 6.89 | 0.63 |
| Kubisch ($hassles^3$) | 6.70 | 0.65 |
model <- gam(
anx ~ s(hassles),
data = hassleframe,
family = gaussian
)
summary(model)
...
R-sq.(adj) = 0.619 Deviance explained = 64.1%
GCV = 49.132 Scale est. = 45.153 n = 40
plot(model)

$y$-Werte: predict(model, type = "terms")
predict(model, newdata = hassleframe, type = "response")

Die richtige Transformation zu kennen ist ideal, aber GAM hilft, wenn sie unbekannt ist
| Modell | RMSE (Cross-Validation) | $R^2$ (Training) |
|---|---|---|
| Linear ($hassles$) | 7.69 | 0.53 |
| Quadratisch ($hassles^2$) | 6.89 | 0.63 |
| Kubisch ($hassles^3$) | 6.70 | 0.65 |
| GAM | 7.06 | 0.64 |
Überwachtes Lernen in R: Regression