用 R 进行市场营销分析的机器学习
Verena Pflieger
Data Scientist at INWT Statistics

summary(multipleLM2)
Residual standard error: 13.87 on 4179 degrees of freedom
Multiple R-squared: 0.3522, Adjusted R-squared: 0.3504
F-statistic: 206.5 on 11 and 4179 DF, p-value: < 2.2e-16

stats 包中的 AIC()MASS 包中的 stepAIC()AIC(multipleLM2)
33950.45
head(clvData2)
# A tibble: 6 x 14
customerID nOrders nItems daysSinceLastOrder margin returnRatio
<int> <int> <int> <int> <dbl> <dbl>
1 2 16 40 2 57.62 0.18
2 3 1 5 124 29.69 1.00
3 4 15 30 68 56.26 0.16
4 5 23 41 103 58.84 0.03
5 6 2 4 104 29.31 0.00
6 7 6 10 41 35.72 0.06
#... with 8 more variables: shareOwnBrand <dbl>, shareVoucher <dbl>,
# shareSale <dbl>, gender <chr>, age <int>, marginPerOrder <dbl>,
# marginPerItem <dbl>, itemsPerOrder <dbl>
predMargin <- predict(multipleLM2,
newdata = clvData2)
head(predMargin)
1 2 3 4 5 6
51.10204 31.63335 51.90008 52.62200 36.65194 33.84383
mean(predMargin, na.rm = TRUE)
33.95147
| 线性回归要点 | |
|---|---|
| 您已学会… | 预测未来的客户生命周期价值(CLV) |
| 用线性回归建模连续变量 | |
| 建模与预测所用变量名必须一致 |
| 模型结论要点 | |
|---|---|
| 您已学会… | 一年期的利润率可较好预测下一年的利润率 |
| 距离上次下单时间越久,期望利润率越低 | |
| 性别与年龄等特征对利润率预测作用不明显 | |
| 等等… |
用 R 进行市场营销分析的机器学习