Unverified Commit d4629727 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] introduce Dataset methods set_field() and get_field() (#4571)



* [R-package] introduce Dataset set_field() and get_field()

* fix incorrect fields

* update pkgdown

* fix example

* fix another example

* Apply suggestions from code review
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>

* update docs
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent 74c7904b
...@@ -11,10 +11,10 @@ test_that("lgb.plot.interepretation works as expected for binary classification" ...@@ -11,10 +11,10 @@ test_that("lgb.plot.interepretation works as expected for binary classification"
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)
setinfo( set_field(
dataset = dtrain dataset = dtrain
, "init_score" , field_name = "init_score"
, rep( , data = rep(
.logit(mean(train$label)) .logit(mean(train$label))
, length(train$label) , length(train$label)
) )
......
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