Functions in custom code

Argument handling functions

  • check_argument_exists(self.args, 'arg', self.messages)
    • Checks if the argument ‘arg’ exists in brick’s arguments
  • check_argument_not_none(self.args, 'arg', self.messages)
    • Checks if the argument ‘arg’ is not None
  • check_argument_not_empty(self.args, 'arg', self.messages)
    • Checks if the argument ‘arg’ is in brick’s arguments and is not empty
  • check_argument_matches_type(self.args, 'arg', arg_type, self.messages)
    • Checks if the argument ‘arg’ is of type arg_type
  • check_argument_in_list(self.args, 'arg', values_list, self.messages)
    • Checks if the value of argument ‘arg’ is in the values_list
  • check_argument_list_in_list(self.args, 'arg', values_list, self.messages)
    • Checks if all the values of argument ‘arg’ are in the values_list
  • check_argument_in_boundaries(self.args, 'arg', value_lower, value_upper, self.messages)
    • Checks if the value of argument ‘arg’ is between value_lower and value_upper (both included)
 

Input handling functions

  • check_number_of_inputs(self, N)
    • Checks if the brick has exactly N inputs
  • check_input_with_type_has_value(self, input_type)
    • Checks if the input with type input_type has a value
  • check_input_model_has_optional_target_variable(self)
    • Checks if the input of model type has an optional target variable
  • check_input_with_index_has_value(self, input_index)
    • Checks if the input with index input_index has a value (indexes start from 0)
  • check_column_in_input_of_type(self, column, input_type)
    • Checks if the column is present in the input with type input_type
       

Calculate metrics functions

  • transform_types(y_true, y_pred)
    • Returns a NumPy representation of the y_true - correct target values DataFrame, and y_pred - estimated target values DataFrame