You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some learners (especiall torch learners) but also e.g. lightgbm break when saved and reloaded.
One situation where this occurs is if one calls benchmark(..., store_models = TRUE).
To avoid this / make it more comfortable for the user, I suggest adding a property "serialize".
If this property is present, a learner must implement a public method serialize() that converts the learners $state into a serialized state.
To implement that, we could save the previous $state of a learner in a private field $.state and make $state an active binding that unserializes a earner's state if it is accessed and serialized.
This allows us to hide the serialization from the user in some circumstances e.g. in the benchmark() function we can call learner$serialize() if store_models is TRUE. The user can then afterwards access the learner and does not have to call learner$unserialize() because this will automatically happen when he accesses the state.
E.g. using bundle, this might look as follows for LightGBM:
Some learners (especiall torch learners) but also e.g. lightgbm break when saved and reloaded.
One situation where this occurs is if one calls
benchmark(..., store_models = TRUE)
.To avoid this / make it more comfortable for the user, I suggest adding a property
"serialize"
.If this property is present, a learner must implement a public method
serialize()
that converts the learners$state
into a serialized state.To implement that, we could save the previous
$state
of a learner in a private field$.state
and make$state
an active binding that unserializes a earner's state if it is accessed and serialized.This allows us to hide the serialization from the user in some circumstances e.g. in the
benchmark()
function we can calllearner$serialize()
ifstore_models
isTRUE
. The user can then afterwards access the learner and does not have to calllearner$unserialize()
because this will automatically happen when he accesses the state.E.g. using bundle, this might look as follows for LightGBM:
In addition to that, it might be convenient to offer a
$save(path)
method that calls$serialize()
and thensaveRDS()
The text was updated successfully, but these errors were encountered: