로지스틱 회귀를 수행하기 위해 GBM
패키지를 사용하고 싶지만 0-1 범위를 벗어난 응답을 약간 제공합니다. 0-1 예측 (bernoulli
및 adaboost
)에 대해 제안 된 배포 매개 변수를 시도했지만 실제로는 gaussian
을 사용하는 것보다 더 나쁜 결과를 만듭니다.R gbm logistic regression
GBM_NTREES = 150
GBM_SHRINKAGE = 0.1
GBM_DEPTH = 4
GBM_MINOBS = 50
> GBM_model <- gbm.fit(
+ x = trainDescr
+ ,y = trainClass
+ ,distribution = "gaussian"
+ ,n.trees = GBM_NTREES
+ ,shrinkage = GBM_SHRINKAGE
+ ,interaction.depth = GBM_DEPTH
+ ,n.minobsinnode = GBM_MINOBS
+ ,verbose = TRUE)
Iter TrainDeviance ValidDeviance StepSize Improve
1 0.0603 nan 0.1000 0.0019
2 0.0588 nan 0.1000 0.0016
3 0.0575 nan 0.1000 0.0013
4 0.0563 nan 0.1000 0.0011
5 0.0553 nan 0.1000 0.0010
6 0.0546 nan 0.1000 0.0008
7 0.0539 nan 0.1000 0.0007
8 0.0533 nan 0.1000 0.0006
9 0.0528 nan 0.1000 0.0005
10 0.0524 nan 0.1000 0.0004
100 0.0484 nan 0.1000 0.0000
150 0.0481 nan 0.1000 -0.0000
> prediction <- predict.gbm(object = GBM_model
+ ,newdata = testDescr
+ ,GBM_NTREES)
> hist(prediction)
> range(prediction)
[1] -0.02945224 1.00706700
베르누이 :
GBM_model <- gbm.fit(
x = trainDescr
,y = trainClass
,distribution = "bernoulli"
,n.trees = GBM_NTREES
,shrinkage = GBM_SHRINKAGE
,interaction.depth = GBM_DEPTH
,n.minobsinnode = GBM_MINOBS
,verbose = TRUE)
prediction <- predict.gbm(object = GBM_model
+ ,newdata = testDescr
+ ,GBM_NTREES)
> hist(prediction)
> range(prediction)
[1] -4.699324 3.043440
그리고 에이다 부스트 :
GBM_model <- gbm.fit(
x = trainDescr
,y = trainClass
,distribution = "adaboost"
,n.trees = GBM_NTREES
,shrinkage = GBM_SHRINKAGE
,interaction.depth = GBM_DEPTH
,n.minobsinnode = GBM_MINOBS
,verbose = TRUE)
> prediction <- predict.gbm(object = GBM_model
+ ,newdata = testDescr
+ ,GBM_NTREES)
> hist(prediction)
> range(prediction)
[1] -3.0374228 0.9323279
, 내가 뭔가 잘못하고있는 중이 야 내가 전처리 (규모, 센터)에 데이터를 필요로하거나 내가 갈 필요합니까 다음과 같이 값을 수동으로 바닥/캡에 넣습니다.
prediction <- ifelse(prediction < 0, 0, prediction)
prediction <- ifelse(prediction > 1, 1, prediction)
데이터를 공유하는 데 주저합니까? – abcde123483