seldonian.spec.createRLSpec¶
- createRLSpec(dataset, policy, constraint_strs, deltas, env_kwargs={}, frac_data_in_safety=0.6, initial_solution_fn=None, use_builtin_primary_gradient_fn=False, save=False, save_dir='.', verbose=False)¶
Convenience function for creating RLSpec object. Uses many defaults which can later be changed by updating the spec object.
- Parameters:
constraint_strs – List of constraint strings
deltas – List of confidence thresholds
env_kwargs (dict) – Kwargs passed to RL_model pertaining to environment, such as gamma, the discount factor
frac_data_in_safety (float) – Fraction of data used in safety test. The remaining fraction will be used in candidate selection
initial_solution_fn (function) – Function to provide initial model weights in candidate selection
use_builtin_primary_gradient_fn (bool, defaults to True) – Whether to use the built-in function for the gradient of the primary objective, if one exists. If False, uses autograd
save – Boolean flag determining whether to save to a file
save_dir (str) – Directory where to save the spec.pkl file
verbose – Boolean glag to control verbosity