ResultData | R Documentation |
Internal object to store results in list of data.tables, arranged in a star schema. It is advised to not directly work on this data structure as it may be changed in the future without further warnings.
The main motivation of this data structure is the necessity to avoid storing duplicated R6 objects.
While this is usually no problem in a single R session, serialization via serialize()
(which is
used in save()
/saveRDS()
or during parallelization) leads to objects with unreasonable memory
requirements.
data
(list()
)
List of data.table::data.table()
, arranged in a star schema.
Do not operate directly on this list.
task_type
(character(1)
)
Returns the task type of stored objects, e.g. "classif"
or "regr"
.
Returns NULL
if the ResultData is empty.
new()
Creates a new instance of this R6 class.
An alternative construction method is provided by as_result_data()
.
ResultData$new(data = NULL, store_backends = TRUE)
data
(data.table::data.table()
) | NULL
)
Do not initialize this object yourself, use as_result_data()
instead.
store_backends
(logical(1)
)
If set to FALSE
, the backends of the Tasks provided in data
are
removed.
uhashes()
Returns all unique hashes (uhash
values) of all included ResampleResults.
ResultData$uhashes(view = NULL)
view
character(1)
Single uhash
to restrict the results to.
character()
.
iterations()
Returns the number of recorded iterations / experiments.
ResultData$iterations(view = NULL)
view
character(1)
Single uhash
to restrict the results to.
integer(1)
.
tasks()
Returns a table of included Tasks.
ResultData$tasks(view = NULL)
view
character(1)
Single uhash
to restrict the results to.
data.table()
with columns "task_hash"
(character()
) and "task"
(Task).
learners()
Returns a table of included Learners.
ResultData$learners(view = NULL, states = TRUE, reassemble = TRUE)
view
character(1)
Single uhash
to restrict the results to.
states
(logical(1)
)
If TRUE
, returns a learner for each iteration/experiment in the ResultData object.
If FALSE
, returns an exemplary learner (without state) for each ResampleResult.
reassemble
(logical(1)
)
Reassemble the learners, i.e. re-set the state
and the hyperparameters which are stored separately before
returning the learners.
data.table()
with columns "learner_hash"
(character()
) and "learner"
(Learner).
learner_states()
Returns a list of states of included Learners without reassembling the learners.
@return list of list()
ResultData$learner_states(view = NULL)
view
character(1)
Single uhash
to restrict the results to.
resamplings()
Returns a table of included Resamplings.
ResultData$resamplings(view = NULL)
view
character(1)
Single uhash
to restrict the results to.
data.table()
with columns "resampling_hash"
(character()
) and "resampling"
(Resampling).
predictions()
Returns a list of Prediction objects.
ResultData$predictions(view = NULL, predict_sets = "test")
view
character(1)
Single uhash
to restrict the results to.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
list()
of Prediction.
prediction()
Returns a combined Prediction objects.
ResultData$prediction(view = NULL, predict_sets = "test")
view
character(1)
Single uhash
to restrict the results to.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
Prediction.
combine()
Combines multiple ResultData objects, modifying self
in-place.
ResultData$combine(rdata)
rdata
(ResultData).
self
(invisibly).
sweep()
Updates the ResultData object, removing rows from all tables which are not referenced by the fact table anymore. E.g., can be called after filtering/subsetting the fact table.
ResultData$sweep()
Modified self
(invisibly).
marshal()
Marshals all stored learner models. This will do nothing to models that are already marshaled.
ResultData$marshal(...)
...
(any)
Additional arguments passed to marshal_model()
.
unmarshal()
Unmarshals all stored learner models. This will do nothing to models which are not marshaled.
ResultData$unmarshal(...)
...
(any)
Additional arguments passed to unmarshal_model()
.
discard()
Shrinks the object by discarding parts of the stored data.
ResultData$discard(backends = FALSE, models = FALSE)
backends
(logical(1)
)
If TRUE
, the DataBackend is removed from all stored Tasks.
models
(logical(1)
)
If TRUE
, the stored model is removed from all Learners.
Modified self
(invisibly).
as_data_table()
Combines internal tables into a single flat data.table()
.
ResultData$as_data_table( view = NULL, reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = "test" )
view
character(1)
Single uhash
to restrict the results to.
reassemble_learners
(logical(1)
)
Reassemble the tasks?
convert_predictions
(logical(1)
)
Convert PredictionData to Prediction?
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
predict_sets
(character()
)
Prediction sets to operate on, used in aggregate()
to extract the matching predict_sets
from the ResampleResult.
Multiple predict sets are calculated by the respective Learner during resample()
/benchmark()
.
Must be a non-empty subset of {"train", "test", "internal_valid"}
.
If multiple sets are provided, these are first combined to a single prediction object.
Default is "test"
.
logs()
Get a table of recorded learner logs.
ResultData$logs(view = NULL, condition)
view
character(1)
Single uhash
to restrict the results to.
condition
(character(1)
)
The condition to extract. One of "message"
, "warning"
or "error"
.
data.table::data.table()
.
clone()
The objects of this class are cloneable with this method.
ResultData$clone(deep = FALSE)
deep
Whether to make a deep clone.
# table overview
print(ResultData$new()$data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.