Commit 8da60f68 authored by Yachen Yan's avatar Yachen Yan Committed by Guolin Ke
Browse files

fix the reshape and predleaf arguments (#244)

parent 112ab6f9
...@@ -85,7 +85,11 @@ Predictor <- R6Class( ...@@ -85,7 +85,11 @@ Predictor <- R6Class(
stop("predict: prediction length ", sQuote(length(preds))," is not a multiple of nrows(data): ", sQuote(num_row)) stop("predict: prediction length ", sQuote(length(preds))," is not a multiple of nrows(data): ", sQuote(num_row))
} }
npred_per_case <- length(preds) / num_row npred_per_case <- length(preds) / num_row
if (reshape && npred_per_case > 1) { preds <- matrix(preds, ncol = npred_per_case) } if (predleaf) {
preds <- matrix(preds, ncol = npred_per_case, byrow = TRUE)
} else if (reshape && npred_per_case > 1) {
preds <- matrix(preds, ncol = npred_per_case, byrow = TRUE)
}
preds preds
} }
), ),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment