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
- calculate_metric_r2(y_true, y_pred)
Calculates the (coefficient of determination) score
- calculate_metric_rmse(y_true, y_pred)
Calculates the RMSE (Root Mean Squared Error) loss
- calculate_metric_mape(y_true, y_pred)
Calculates the MAPE (Mean Absolute Percentage Error) loss
- calculate_metric_accuracy(y_true, y_pred)
Calculates the accuracy score
- calculate_precision_recall_fscore_support(y_true, y_pred, average)
Calculates precision, recall, F-measure, and support (the number of occurrences of each class in y_true) for each class