src.model.tdcomp.training_data_component

Classes

TrainingDataComponent(**kwargs)

Exceptions

TrainingDataComponentException([message])

exception src.model.tdcomp.training_data_component.TrainingDataComponentException(message='')
Author:

Alberto M. Esmoris Pena

Class for exceptions related to components for training data pipelines. See Model.

__init__(message='')
class src.model.tdcomp.training_data_component.TrainingDataComponent(**kwargs)
Author:

Alberto M. Esmoris Pena

Abstract class providing the interface governing any training data component.

Variables:

component_args (dict) – The key-word arguemnts for the component of the training data pipeline.

static extract_component_args(spec)

Extract the arguments to initialize/instantiate a TrainingDataComponent from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a TrainingDataComponent.

__init__(**kwargs)

Root initialization for any instance of type TrainingDataComponent.

Parameters:

kwargs – The attributes for the TrainingDataComponent.

abstractmethod __call__(X, y)

Run the component on the given training data and return the transformed version of the training data.

Parameters:
  • X – The input to the model, typically the attributes.

  • y – The expected classes.

Returns:

The new attributes and expected classes for model training.

Return type:

tuple (X, y)

static build_pipeline(spec)

Build a pipeline from a training data pipeline specification.

Parameters:

spec (list) – A list of dictionaries where each dictionary represents a training data component.

Returns:

The built pipeline.

Return type:

list of TrainingDataComponent

static build_component(spec)

Build the received training data component.

Parameters:

spec – The specification of the training data component to be built.

Returns:

The built training data component.

Return type:

TrainingDataComponent