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
af6a33e7
Commit
af6a33e7
authored
Aug 31, 2018
by
James Lamb
Committed by
Laurae
Aug 31, 2018
Browse files
[R-package] added missing importFroms in NAMESPACE (#1627)
parent
5bb5f1b9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
24 deletions
+36
-24
R-package/NAMESPACE
R-package/NAMESPACE
+3
-0
R-package/R/lgb.cv.R
R-package/R/lgb.cv.R
+1
-0
R-package/R/lgb.importance.R
R-package/R/lgb.importance.R
+1
-1
R-package/R/lgb.interprete.R
R-package/R/lgb.interprete.R
+5
-0
R-package/R/lgb.plot.interpretation.R
R-package/R/lgb.plot.interpretation.R
+26
-23
No files found.
R-package/NAMESPACE
View file @
af6a33e7
...
...
@@ -38,9 +38,11 @@ export(slice)
import(methods)
importFrom(R6,R6Class)
importFrom(data.table,":=")
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,rbindlist)
importFrom(data.table,set)
importFrom(data.table,setnames)
importFrom(graphics,barplot)
importFrom(graphics,par)
importFrom(jsonlite,fromJSON)
...
...
@@ -49,4 +51,5 @@ importFrom(magrittr,"%T>%")
importFrom(magrittr,extract)
importFrom(magrittr,inset)
importFrom(methods,is)
importFrom(stats,quantile)
useDynLib(lib_lightgbm , .registration = TRUE)
R-package/R/lgb.cv.R
View file @
af6a33e7
...
...
@@ -373,6 +373,7 @@ generate.cv.folds <- function(nfold, nrows, stratified, label, group, params) {
# Creates CV folds stratified by the values of y.
# It was borrowed from caret::lgb.stratified.folds and simplified
# by always returning an unnamed list of fold indices.
#' @importFrom stats quantile
lgb.stratified.folds
<-
function
(
y
,
k
=
10
)
{
## Group the numeric data based on their magnitudes
...
...
R-package/R/lgb.importance.R
View file @
af6a33e7
...
...
@@ -30,7 +30,7 @@
#' tree_imp1 <- lgb.importance(model, percentage = TRUE)
#' tree_imp2 <- lgb.importance(model, percentage = FALSE)
#'
#' @importFrom magrittr %>% %T>%
#' @importFrom magrittr %>% %T>%
extract
#' @importFrom data.table :=
#' @export
lgb.importance
<-
function
(
model
,
percentage
=
TRUE
)
{
...
...
R-package/R/lgb.interprete.R
View file @
af6a33e7
...
...
@@ -38,6 +38,7 @@
#'
#' tree_interpretation <- lgb.interprete(model, test$data, 1:5)
#'
#' @importFrom data.table as.data.table
#' @importFrom magrittr %>% %T>%
#' @export
lgb.interprete
<-
function
(
model
,
...
...
@@ -76,6 +77,7 @@ lgb.interprete <- function(model,
}
#' @importFrom data.table data.table
single.tree.interprete
<-
function
(
tree_dt
,
tree_id
,
leaf_id
)
{
...
...
@@ -119,6 +121,8 @@ single.tree.interprete <- function(tree_dt,
}
#' @importFrom data.table rbindlist
#' @importFrom magrittr %>% extract
multiple.tree.interprete
<-
function
(
tree_dt
,
tree_index
,
leaf_index
)
{
...
...
@@ -134,6 +138,7 @@ multiple.tree.interprete <- function(tree_dt,
}
#' @importFrom data.table set setnames
single.row.interprete
<-
function
(
tree_dt
,
num_class
,
tree_index_mat
,
leaf_index_mat
)
{
# Prepare vector list
...
...
R-package/R/lgb.plot.interpretation.R
View file @
af6a33e7
...
...
@@ -34,7 +34,9 @@
#'
#' tree_interpretation <- lgb.interprete(model, test$data, 1:5)
#' lgb.plot.interpretation(tree_interpretation[[1]], top_n = 10)
#' @importFrom data.table setnames
#' @importFrom graphics barplot par
#' @importFrom magrittr inset
#' @export
lgb.plot.interpretation
<-
function
(
tree_interpretation_dt
,
top_n
=
10
,
...
...
@@ -85,6 +87,7 @@ lgb.plot.interpretation <- function(tree_interpretation_dt,
}
}
#' @importFrom graphics barplot
multiple.tree.plot.interpretation
<-
function
(
tree_interpretation
,
top_n
,
title
,
...
...
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