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
029bcc42
"tests/vscode:/vscode.git/clone" did not exist on "23403a7c2c4d38961506968291f13c3f344ccb6f"
Commit
029bcc42
authored
Aug 31, 2018
by
James Lamb
Committed by
Laurae
Aug 31, 2018
Browse files
[R-package] updated examples and removed dontrun guards on them in roxygen (#1626)
parent
abd73765
Changes
46
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
20 deletions
+10
-20
R-package/man/lgb.unloader.Rd
R-package/man/lgb.unloader.Rd
+0
-2
R-package/man/predict.lgb.Booster.Rd
R-package/man/predict.lgb.Booster.Rd
+0
-2
R-package/man/readRDS.lgb.Booster.Rd
R-package/man/readRDS.lgb.Booster.Rd
+0
-2
R-package/man/saveRDS.lgb.Booster.Rd
R-package/man/saveRDS.lgb.Booster.Rd
+9
-10
R-package/man/setinfo.Rd
R-package/man/setinfo.Rd
+0
-2
R-package/man/slice.Rd
R-package/man/slice.Rd
+1
-2
No files found.
R-package/man/lgb.unloader.Rd
View file @
029bcc42
...
@@ -20,7 +20,6 @@ NULL invisibly.
...
@@ -20,7 +20,6 @@ NULL invisibly.
Attempts
to
unload
LightGBM
packages
so
you
can
remove
objects
cleanly
without
having
to
restart
R
.
This
is
useful
for
instance
if
an
object
becomes
stuck
for
no
apparent
reason
and
you
do
not
want
to
restart
R
to
fix
the
lost
object
.
Attempts
to
unload
LightGBM
packages
so
you
can
remove
objects
cleanly
without
having
to
restart
R
.
This
is
useful
for
instance
if
an
object
becomes
stuck
for
no
apparent
reason
and
you
do
not
want
to
restart
R
to
fix
the
lost
object
.
}
}
\
examples
{
\
examples
{
\
dontrun
{
library
(
lightgbm
)
library
(
lightgbm
)
data
(
agaricus
.
train
,
package
=
"lightgbm"
)
data
(
agaricus
.
train
,
package
=
"lightgbm"
)
train
<-
agaricus
.
train
train
<-
agaricus
.
train
...
@@ -43,6 +42,5 @@ gc() # Not needed if wipe = TRUE
...
@@ -43,6 +42,5 @@ gc() # Not needed if wipe = TRUE
library
(
lightgbm
)
library
(
lightgbm
)
#
Do
whatever
you
want
again
with
LightGBM
without
object
clashing
#
Do
whatever
you
want
again
with
LightGBM
without
object
clashing
}
}
}
R-package/man/predict.lgb.Booster.Rd
View file @
029bcc42
...
@@ -44,7 +44,6 @@ number of columns corresponding to the number of trees.
...
@@ -44,7 +44,6 @@ number of columns corresponding to the number of trees.
Predicted values based on class \code{lgb.Booster}
Predicted values based on class \code{lgb.Booster}
}
}
\examples{
\examples{
\dontrun{
library(lightgbm)
library(lightgbm)
data(agaricus.train, package = "lightgbm")
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
train <- agaricus.train
...
@@ -62,6 +61,5 @@ model <- lgb.train(params,
...
@@ -62,6 +61,5 @@ model <- lgb.train(params,
learning_rate = 1,
learning_rate = 1,
early_stopping_rounds = 10)
early_stopping_rounds = 10)
preds <- predict(model, test$data)
preds <- predict(model, test$data)
}
}
}
R-package/man/readRDS.lgb.Booster.Rd
View file @
029bcc42
...
@@ -18,7 +18,6 @@ lgb.Booster.
...
@@ -18,7 +18,6 @@ lgb.Booster.
Attempts
to
load
a
model
using
RDS
.
Attempts
to
load
a
model
using
RDS
.
}
}
\
examples
{
\
examples
{
\
dontrun
{
library
(
lightgbm
)
library
(
lightgbm
)
data
(
agaricus
.
train
,
package
=
"lightgbm"
)
data
(
agaricus
.
train
,
package
=
"lightgbm"
)
train
<-
agaricus
.
train
train
<-
agaricus
.
train
...
@@ -37,6 +36,5 @@ model <- lgb.train(params,
...
@@ -37,6 +36,5 @@ model <- lgb.train(params,
early_stopping_rounds
=
10
)
early_stopping_rounds
=
10
)
saveRDS
.
lgb
.
Booster
(
model
,
"model.rds"
)
saveRDS
.
lgb
.
Booster
(
model
,
"model.rds"
)
new_model
<-
readRDS
.
lgb
.
Booster
(
"model.rds"
)
new_model
<-
readRDS
.
lgb
.
Booster
(
"model.rds"
)
}
}
}
R-package/man/saveRDS.lgb.Booster.Rd
View file @
029bcc42
...
@@ -29,7 +29,6 @@ NULL invisibly.
...
@@ -29,7 +29,6 @@ NULL invisibly.
Attempts
to
save
a
model
using
RDS
.
Has
an
additional
parameter
(\
code
{
raw
})
which
decides
whether
to
save
the
raw
model
or
not
.
Attempts
to
save
a
model
using
RDS
.
Has
an
additional
parameter
(\
code
{
raw
})
which
decides
whether
to
save
the
raw
model
or
not
.
}
}
\
examples
{
\
examples
{
\
dontrun
{
library
(
lightgbm
)
library
(
lightgbm
)
data
(
agaricus
.
train
,
package
=
"lightgbm"
)
data
(
agaricus
.
train
,
package
=
"lightgbm"
)
train
<-
agaricus
.
train
train
<-
agaricus
.
train
...
@@ -39,14 +38,14 @@ test <- agaricus.test
...
@@ -39,14 +38,14 @@ test <- agaricus.test
dtest
<-
lgb
.
Dataset
.
create
.
valid
(
dtrain
,
test
$
data
,
label
=
test
$
label
)
dtest
<-
lgb
.
Dataset
.
create
.
valid
(
dtrain
,
test
$
data
,
label
=
test
$
label
)
params
<-
list
(
objective
=
"regression"
,
metric
=
"l2"
)
params
<-
list
(
objective
=
"regression"
,
metric
=
"l2"
)
valids
<-
list
(
test
=
dtest
)
valids
<-
list
(
test
=
dtest
)
model
<-
lgb
.
train
(
params
,
model
<-
lgb
.
train
(
dtrain
,
params
100
,
,
dtrain
valids
,
,
100
min_data
=
1
,
,
valids
learning_rate
=
1
,
,
min_data
=
1
early_stopping_rounds
=
10
)
,
learning_rate
=
1
,
early_stopping_rounds
=
10
)
saveRDS
.
lgb
.
Booster
(
model
,
"model.rds"
)
saveRDS
.
lgb
.
Booster
(
model
,
"model.rds"
)
}
}
}
R-package/man/setinfo.Rd
View file @
029bcc42
...
@@ -35,7 +35,6 @@ The \code{name} field can be one of the following:
...
@@ -35,7 +35,6 @@ The \code{name} field can be one of the following:
}
}
}
}
\examples{
\examples{
\dontrun{
library(lightgbm)
library(lightgbm)
data(agaricus.train, package = "lightgbm")
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
train <- agaricus.train
...
@@ -47,6 +46,5 @@ lightgbm::setinfo(dtrain, "label", 1 - labels)
...
@@ -47,6 +46,5 @@ lightgbm::setinfo(dtrain, "label", 1 - labels)
labels2 <- lightgbm::getinfo(dtrain, "label")
labels2 <- lightgbm::getinfo(dtrain, "label")
stopifnot(all.equal(labels2, 1 - labels))
stopifnot(all.equal(labels2, 1 - labels))
}
}
}
R-package/man/slice.Rd
View file @
029bcc42
...
@@ -24,14 +24,13 @@ Get a new \code{lgb.Dataset} containing the specified rows of
...
@@ -24,14 +24,13 @@ Get a new \code{lgb.Dataset} containing the specified rows of
original lgb.Dataset object
original lgb.Dataset object
}
}
\examples{
\examples{
\dontrun{
library(lightgbm)
library(lightgbm)
data(agaricus.train, package = "lightgbm")
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
dtrain <- lgb.Dataset(train$data, label = train$label)
dsub <- lightgbm::slice(dtrain, 1:42)
dsub <- lightgbm::slice(dtrain, 1:42)
lgb.Dataset.construct(dsub)
labels <- lightgbm::getinfo(dsub, "label")
labels <- lightgbm::getinfo(dsub, "label")
}
}
}
Prev
1
2
3
Next
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