AllocationRule {RLoptimal} | R Documentation |
Allocation Rule Class
Description
This class represents an allocation rule that generates a next allocation.
Public fields
policy
The RLlib policy that is a Python object.
dir
Directory path of the allocation rule (policy).
dirpath
Full path to the directory of the allocation rule.
created_at
Created time of this object.
info
Information when learning the allocation rule.
input
Inputs for learning the allocation rule.
log
The log of scores during the learning of the allocation rule.
checkpoints
The integer vector of iteration counts for checkpoints.
checkpoints_paths
The paths to the directories where each checkpoint is stored.
Methods
Public methods
Method new()
Create a new AllocationRule object.
Usage
AllocationRule$new(dir = "latest", base_dir = "allocation_rules")
Arguments
dir
A character value. A directory name or path where an allocation rule is outputted. By default, the latest allocation rule is searched in 'base_dir'.
base_dir
A character value. A directory path that is used as the parent directory if the 'dir' argument is a directory name and is not used otherwise.
Method opt_allocation_probs()
Compute optimal allocation probabilities using the obtained allocation rule for dose and response data.
Usage
AllocationRule$opt_allocation_probs(data_doses, data_resps)
Arguments
data_doses
A numeric vector. The doses actually administered to each subject in your clinical trial. It must include all previous doses.
data_resps
A numeric vector. The values of responses corresponding to each subject for the 'data_doses' argument.
Returns
A vector of the probabilities of the doses.
Method resume_learning()
Resume learning the allocation rule. This function updates the original AllocationRule object.
Usage
AllocationRule$resume_learning(iter)
Arguments
iter
A number of additional iterations.
Returns
An updated AllocationRule object.
Method set_info()
Set information when learning the allocation rule.
Usage
AllocationRule$set_info(info, input, log, checkpoints)
Arguments
info
Information when learning the allocation rule.
input
Inputs for learning the allocation rule.
log
The log of scores during the learning of the allocation rule.
checkpoints
The paths to the directories where each checkpoint is stored.
Method print()
Print function for AllocationRule object
Usage
AllocationRule$print()
Method clone()
The objects of this class are cloneable with this method.
Usage
AllocationRule$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.