Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
8da60f68
Commit
8da60f68
authored
Jan 21, 2017
by
Yachen Yan
Committed by
Guolin Ke
Jan 22, 2017
Browse files
fix the reshape and predleaf arguments (#244)
parent
112ab6f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
R-package/R/lgb.Predictor.R
R-package/R/lgb.Predictor.R
+5
-1
No files found.
R-package/R/lgb.Predictor.R
View file @
8da60f68
...
...
@@ -85,7 +85,11 @@ Predictor <- R6Class(
stop
(
"predict: prediction length "
,
sQuote
(
length
(
preds
)),
" is not a multiple of nrows(data): "
,
sQuote
(
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
}
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment