用H2O做了个deep learning的例子(0、1二分类),对比logistic回归、GAM、SVM等,综合表现最差,比较郁闷。deep learning中可以调节的参数很多,不确定是参数问题还是其它问题。有了解的童鞋吗?
R程序:
(1) library(h2o) localH2O = h2o.init() woedata.h2o <- as.h2o(woedata) woemdl.dl <- h2o.deeplearning(x = 2:5, y = 1, training_frame = woedata.h2o, score_training_samples = 0) woemdl.dl prd.dl <- h2o.predict(woemdl.dl, woedata.h2o) h2o.table(prd.dl[,1], woedata.h2o[,1]) |
(2) trainData.h2o <- as.h2o(trainData) trainmdl.dl <- h2o.deeplearning(x = 1:4, y = 5, training_frame = trainData.h2o, score_training_samples = 0) trainmdl.dl |
(3) woemdl.dl <- h2o.deeplearning(x = 2:5, y = 1, training_frame = woedata.h2o, score_training_samples = 0,activation="Maxout") woemdl.dl |
(4) woemdl.dl <- h2o.deeplearning(x = 2:5, y = 1, training_frame = woedata.h2o, score_training_samples = 0,activation="MaxoutWithDropout") woemdl.dl |
(5) woemdl.dl <- h2o.deeplearning(x = 2:5, y = 1, training_frame = woedata.h2o, score_training_samples = 0,activation="Maxout", hidden = c(350, 200), epochs=10) woemdl.dl |
(6) woemdl.dl <- h2o.deeplearning(x = 2:5, y = 1, training_frame = woedata.h2o, score_training_samples = 0,activation="RectifierWithDropout", input_dropout_ratio=0, hidden_dropout_ratios=c(0.2,0.1,0.1,0), l1=1e-5, l2=1e-5, hidden = c(200,200,200,200), epochs=15) |
结果:
(1) 0 1 Error Rate 0 5790 7941 0.578326 =7941/13731 1 1446 4473 0.244298 =1446/5919 Totals 7236 12414 0.477710 =9387/19650
predict y count 1 1 1 4473 2 0 0 5790 3 0 1 1446 4 1 0 7941 |
(2) 0 1 Error Rate 0 5787 7944 0.578545 =7944/13731 1 1357 4562 0.229262 =1357/5919 Totals 7144 12506 0.473333 =9301/19650 |
(3) 0 1 Error Rate 0 7414 6317 0.460054 =6317/13731 1 2060 3859 0.348032 =2060/5919 Totals 9474 10176 0.426310 =8377/19650 |
(4) 0 1 Error Rate 0 6875 6856 0.499308 =6856/13731 1 1831 4088 0.309343 =1831/5919 Totals 8706 10944 0.442087 =8687/19650 |
(5) 0 1 Error Rate 0 7501 6230 0.453718 =6230/13731 1 2037 3882 0.344146 =2037/5919 Totals 9538 10112 0.420712 =8267/19650 |
(6) 0 1 Error Rate 0 6669 7062 0.514311 =7062/13731 1 1779 4140 0.300558 =1779/5919 Totals 8448 11202 0.449924 =8841/19650 |