Skip to content

Commit 2d61458

Browse files
author
Chen Ying
authored
Merge pull request #521 from GoekeLab/xgboost_x_y_rename_v4
fix xgboost data and label rename to x and y warning
2 parents e07fbad + 2cb63fc commit 2d61458

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

R/bambu-processReads_utilityJunctionErrorCorrection.R

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,10 @@ fitXGBoostModel <- function(labels.train, data.train, nrounds = 50,
211211
data.train.cv.test <- data.train[-mySample,]
212212
labels.train.cv.test <- labels.train[-mySample]
213213

214-
cv.fit <- xgboost(data = data.train.cv,
215-
label = labels.train.cv, nthread = 1, nrounds = nrounds,
214+
cv.fit <- xgboost(x = data.train.cv,
215+
y = labels.train.cv, nthread = 1, nrounds = nrounds,
216216
objective = "binary:logistic",
217-
eval_metric = 'error',
218-
verbose = 0)
217+
eval_metric = 'error')
219218
predictions <- predict(cv.fit, data.train.cv.test)
220219
message('prediction accuracy (CV) (higher for splice ',
221220
'donor than splice acceptor)')
@@ -229,11 +228,10 @@ fitXGBoostModel <- function(labels.train, data.train, nrounds = 50,
229228
message("AUC: ", evaluatePerformance(labels.train.cv.test == 1,predictions)$AUC)
230229
}
231230

232-
cv.fit <- xgboost(data = data.train,
233-
label = labels.train, nthread=1, nrounds=nrounds,
231+
cv.fit <- xgboost(x = data.train,
232+
y = labels.train, nthread=1, nrounds=nrounds,
234233
objective = "binary:logistic",
235-
eval_metric='error',
236-
verbose = 0)
234+
eval_metric='error')
237235

238236
return(cv.fit)
239237
}

0 commit comments

Comments
 (0)