doenut.models.averaged_model_set

Module Contents

Classes

AveragedModelSet

Class to train and hold a group of related (averaged) models.

Attributes

logger

doenut.models.averaged_model_set.logger
class doenut.models.averaged_model_set.AveragedModelSet(default_inputs: pandas.DataFrame = None, default_responses: pandas.DataFrame = None, default_scale_data: bool = True, default_scale_run_data: bool = True, default_fit_intercept: bool = True, default_response_key: list = [0], default_drop_duplicates: str = 'yes', default_input_selector: list = [])[source]

Bases: doenut.models.model_set.ModelSet

Class to train and hold a group of related (averaged) models. When constructing the AveragedModelSet, you can define default values. Then when adding a new model to the set you only have to specify the parameters which differ from the default.

Parameters:
  • default_inputs (pd.DataFrame, optional) – The default inputs to the model

  • default_responses (pd.DataFrame, optional) – The default responses for the model

  • default_scale_data (bool, optional) – Whether to scale the data before adding to the model by default

  • default_scale_run_data (bool, optional) – Whether to scale the data for each train/test set by default

  • default_fit_intercept (bool, optional) – Whether to fit the model’s intercept to the axis by default

  • default_response_key (str, optional) – The default column to pick from the responses

  • default_drop_duplicates ({'no', 'yes', 'averages'}, optional) – What to do with duplicates in the inputs, by default

  • default_input_selector (List, optional) – What columns from the input data to select by default

classmethod multiple_response_columns(inputs: pandas.DataFrame = None, responses: pandas.DataFrame = None, scale_data: bool = True, scale_run_data: bool = True, fit_intercept: bool = True, drop_duplicates: str = 'yes', input_selector: list = []) AveragedModelSet[source]
add_model(inputs=None, responses=None, scale_data=None, scale_run_data=None, fit_intercept=None, response_key=None, drop_duplicates=None, input_selector=None)[source]

Add a new AveragedModel to the set

Parameters:
  • inputs (pd.DataFrame, optional) – The inputs to the model

  • responses (pd.DataFrame, optional) – The responses for the model

  • scale_data (bool, optional) – Whether to scale the data before adding to the model

  • scale_run_data (bool, optional) – Whether to scale the data for each train/test set

  • fit_intercept (bool, optional) – Whether to fit the model’s intercept to the axis

  • response_key (str, optional) – The column to pick from the responses

  • drop_duplicates ({'no', 'yes', 'averages'}, optional) – What to do with duplicates in the inputs

  • input_selector (List, optional) – What columns from the input data to select

Returns:

The generated model

Return type:

doenut.models.AveragedModel