【发布时间】:2016-01-29 08:41:12
【问题描述】:
我正在使用以下数据集:http://www.sgi.com/tech/mlc/db/churn.data
以及变量描述:http://www.sgi.com/tech/mlc/db/churn.names
我做了初步编码,但我真的无法弄清楚如何对这些数据执行逻辑回归和随机森林技术来预测变量和流失率的重要性。
nm <- read.csv("http://www.sgi.com/tech/mlc/db/churn.names",
skip=4, colClasses=c("character", "NULL"), header=FALSE, sep=":")[[1]]
nm
dat <- read.csv("http://www.sgi.com/tech/mlc/db/churn.data", header=FALSE, col.names=c(nm, "Churn"))
dat
View(dat)
View(dat)
library(survival)
s <- with(dat, Surv(account.length, as.numeric(Churn)))
model <- coxph(s ~ total.day.charge + number.customer.service.calls, data=dat[, -4])
summary(model)
plot(survfit(model))
我也无法弄清楚如何使用我在进一步分析中建立的模型。
请帮帮我。
【问题讨论】:
标签: r svm random-forest logistic-regression