Hyperparameter: Hyperparameter Class

HyperparameterR Documentation

Hyperparameter Class

Description

An algorithm hyperparameter with optional validation. Implemented as a python descriptor object.

Public fields

validation

validation function

validation_message

validation message

name

name of hyperparameter validate

data_type

function to convert data type

obj

parent class to alter

Active bindings

descriptor

active binding that mimic's python descriptor class

Methods

Public methods


Method new()

Usage
Hyperparameter$new(
  name,
  validate = function(x) TRUE,
  validation_message = "",
  data_type = as.character,
  obj
)
Arguments
name

(str): The name of this hyperparameter validate

validate

(callable[object]->[bool]): A validation function or list of validation functions. Each function validates an object and returns False if the object value is invalid for this hyperparameter.

validation_message

(str): A usage guide to display on validation failure.

data_type

: function to convert data types

obj

(R6Class): R6Class for descriptor class to modify


Method validate()

Validate value

Usage
Hyperparameter$validate(value = NULL)
Arguments
value

: values to be validated


Method serialize_all()

Return all non-None “hyperparameter“ values on “obj“ as a “dict[str,str].“

Usage
Hyperparameter$serialize_all(obj)
Arguments
obj

: R object to be serialized


Method clone()

The objects of this class are cloneable with this method.

Usage
Hyperparameter$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-mlcore documentation built on May 3, 2022, 10:08 a.m.