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
f3f2f5a9
Commit
f3f2f5a9
authored
Jan 08, 2017
by
Guolin Ke
Browse files
[R-package] add reset parameters for CV object
parent
88e6beb8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
R-package/R/lgb.cv.R
R-package/R/lgb.cv.R
+12
-0
No files found.
R-package/R/lgb.cv.R
View file @
f3f2f5a9
...
...
@@ -7,6 +7,12 @@ CVBooster <- R6Class(
boosters
=
list
(),
initialize
=
function
(
x
){
self
$
boosters
<-
x
},
reset_parameter
=
function
(
new_paramas
){
for
(
x
in
boosters
){
x
$
reset_parameter
(
new_paramas
)
}
return
(
self
)
}
)
)
...
...
@@ -270,7 +276,13 @@ lgb.stratified.folds <- function(y, k = 10)
}
lgb.merge.cv.result
<-
function
(
msg
,
showsd
=
TRUE
){
if
(
length
(
msg
)
==
0
){
stop
(
"lgb.cv: size of cv result error"
)
}
eval_len
<-
length
(
msg
[[
1
]])
if
(
eval_len
==
0
){
stop
(
"lgb.cv: should provide at least metric for CV"
)
}
eval_result
<-
lapply
(
1
:
eval_len
,
function
(
j
)
{
as.numeric
(
lapply
(
1
:
length
(
msg
),
function
(
i
){
msg
[[
i
]][[
j
]]
$
value
...
...
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