Ну нелинейно так нелинейно

Итак randomForest, он сразу пишет бутстреп оценку насколько можно доверять его результатам (естественно обучающую выборку пилит со 100% точностью)
Код
> names(data.sh.f)
[1] "X..bolnogo" "AIK" "CA"
[4] "Progres" "OP" "Shunt"
[7] "Srok.gruppy" "vozrast" "IMT"
[10] "Stepen.Oz." "pol" "tip.krovoobraschenija"
[13] "ChSS" "AD" "AG.therapia"
[16] "Statiny" "cholesterin" "stenoz.a.renalis"
[19] "stenoz.arterij.nog" "insult.v.anamnese" "diabetus.melitus"
[22] "tip.1" "tip.2" "tip.3"
[25] "statin.ter" "statin.break" "statin.doz"
> randomForest(data.sh.f[,-c(1,4,16,12)], y=factor(data.sh.f$Progres))
Call:
randomForest(x = data.sh.f[, -c(1, 4, 16, 12)], y = factor(data.sh.f$Progres))
Type of random forest: classification
Number of trees: 500
No. of variables tried at each split: 4
OOB estimate of error rate: 40.32%
Confusion matrix:
0 1 class.error
0 15 14 0.4827586
1 11 22 0.3333333
>
важность переменных
> randomForest(data.sh.f[,c(7,8,9,17)], y=factor(data.sh.f$Progres))
Call:
randomForest(x = data.sh.f[, c(7, 8, 9, 17)], y = factor(data.sh.f$Progres))
Type of random forest: classification
Number of trees: 500
No. of variables tried at each split: 2
OOB estimate of error rate: 40.32%
Confusion matrix:
0 1 class.error
0 18 11 0.3793103
1 14 19 0.4242424
varImpPlot(randomForest(data.sh.f[,-c(1,4,16,12)], y=factor(data.sh.f$Progres)), type=2)
ну типа вот нелинейная важность данных для классификации.
присоединим картинку как он классифицирует по первым самым важным.
а не такая плохая модель
Код
> m.rf <-glm(Progres ~ Srok.gruppy + cholesterin + IMT + vozrast ,
+ family=binomial(logit),
+ data.sh.f)
> roc.m.rf.f <- roc(data.sh.f$Progres, # данные из выборки
+ predict(m.rf, type="response")) # предсказание модели
> densityplot( ~ predict(m.rf,
+ type = "response"),
+ groups = data.sh.f$Progres,
+ plot.points = "rug",
+ auto.key = TRUE)
> plot(roc.m.rf.f)
Call:
roc.default(response = data.sh.f$Progres, predictor = predict(m.rf, type = "response"))
Data: predict(m.rf, type = "response") in 29 controls (data.sh.f$Progres 0) < 33 cases (data.sh.f$Progres 1).
Area under the curve: 0.7827
> ci.auc(roc.m.rf.f)
95% CI: 0.6579-0.9074 (DeLong)