data_models.domain.features.Outputs

data_models.domain.features.Outputs()

Container of output features, only output features are allowed.

Attributes

Name Type Description
features List(Outputs list of the features.

Methods

Name Description
add_valid_columns Add the valid_{feature.key} columns to the experiments dataframe,
get_by_objective Get output features filtered by the type of the attached objective.
get_keys_by_objective Get keys of output features filtered by the type of the attached objective.
preprocess_experiments_all_valid_outputs Method to get a dataframe where non-valid entries of all output feature are removed
preprocess_experiments_any_valid_output Method to get a dataframe where at least one output feature has a valid entry
preprocess_experiments_one_valid_output Method to get a dataframe where non-valid entries of the provided output feature are removed

add_valid_columns

data_models.domain.features.Outputs.add_valid_columns(experiments)

Add the valid_{feature.key} columns to the experiments dataframe, in case that they are not present.

Parameters

Name Type Description Default
experiments pd.DataFrame Dataframe holding the experiments. required

Returns

Name Type Description
pd.DataFrame pd.DataFrame: Dataframe holding the experiments.

get_by_objective

data_models.domain.features.Outputs.get_by_objective(
    includes=Objective,
    excludes=None,
    exact=False,
)

Get output features filtered by the type of the attached objective.

Parameters

Name Type Description Default
includes Union[List[TObjective], TObjective] Objective class or list of objective classes to be returned. Defaults to Objective. Objective
excludes Union[List[TObjective], TObjective, None] Objective class or list of specific objective classes to be excluded from the return. Defaults to None. None
exact bool Boolean to distinguish if only the exact classes listed in includes and no subclasses inherenting from this class shall be returned. Defaults to False. False

Returns

Name Type Description
Outputs List[AnyOutput]: List of output features fitting to the passed requirements.

get_keys_by_objective

data_models.domain.features.Outputs.get_keys_by_objective(
    includes=Objective,
    excludes=None,
    exact=False,
)

Get keys of output features filtered by the type of the attached objective.

Parameters

Name Type Description Default
includes Union[List[TObjective], TObjective] Objective class or list of objective classes to be returned. Defaults to Objective. Objective
excludes Union[List[TObjective], TObjective, None] Objective class or list of specific objective classes to be excluded from the return. Defaults to None. None
exact bool Boolean to distinguish if only the exact classes listed in includes and no subclasses inherenting from this class shall be returned. Defaults to False. False

Returns

Name Type Description
List[str] List[str]: List of output feature keys fitting to the passed requirements.

preprocess_experiments_all_valid_outputs

data_models.domain.features.Outputs.preprocess_experiments_all_valid_outputs(
    experiments,
    output_feature_keys=None,
)

Method to get a dataframe where non-valid entries of all output feature are removed

Parameters

Name Type Description Default
experiments pd.DataFrame Dataframe with experimental data required
output_feature_keys Optional[List] List of output feature keys which should be considered for removal of invalid values. Defaults to None. None

Returns

Name Type Description
pd.DataFrame pd.DataFrame: Dataframe with all experiments where only valid entries of the selected features are included

preprocess_experiments_any_valid_output

data_models.domain.features.Outputs.preprocess_experiments_any_valid_output(
    experiments,
)

Method to get a dataframe where at least one output feature has a valid entry

Parameters

Name Type Description Default
experiments pd.DataFrame Dataframe with experimental data required

Returns

Name Type Description
pd.DataFrame pd.DataFrame: Dataframe with all experiments where at least one output feature has a valid entry

preprocess_experiments_one_valid_output

data_models.domain.features.Outputs.preprocess_experiments_one_valid_output(
    output_feature_key,
    experiments,
)

Method to get a dataframe where non-valid entries of the provided output feature are removed

Parameters

Name Type Description Default
experiments pd.DataFrame Dataframe with experimental data required
output_feature_key str The feature based on which non-valid entries rows are removed required

Returns

Name Type Description
pd.DataFrame pd.DataFrame: Dataframe with all experiments where only valid entries of the specific feature are included