coco_pipe.decoding.ExperimentConfig#

class coco_pipe.decoding.ExperimentConfig(*, task='classification', output_dir=None, tag='experiment', random_state=None, models, grids=None, cv=<factory>, tuning=<factory>, feature_selection=<factory>, reducer=<factory>, calibration=<factory>, statistical_assessment=<factory>, metrics=<factory>, use_scaler=True, n_jobs=-1, verbose=True)#

Bases: BaseModel

Master configuration for a Decoding Experiment.

This model serves as the single source of truth for an entire analysis, including data handling, model selection, hyperparameter tuning, feature selection, and statistical inference.

Parameters:
task: MetricTask#
output_dir: Path | None#
tag: str#
random_state: int | None#
models: dict[str, ModelConfigType]#
grids: dict[str, dict[str, list[Any]]] | None#
cv: CVConfig#
tuning: TuningConfig#
feature_selection: FeatureSelectionConfig#
reducer: ReducerConfig#
calibration: CalibrationConfig#
statistical_assessment: StatisticalAssessmentConfig#
metrics: list[str]#
use_scaler: bool | str#
n_jobs: int#
verbose: bool#
get_all_evaluation_metrics()#

Union of primary experiment metrics and stats-specific metrics.

Return type:

list[str]

__hash__ = None#
__iter__()#

So dict(model) works.

Return type:

Generator[tuple[str, Any], None, None]

copy(*, include=None, exclude=None, update=None, deep=False)#

Returns a copy of the model.

!!! warning “Deprecated”

This method is now deprecated; use model_copy instead.

If you need include or exclude, use:

`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `

Parameters:
  • include (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to include in the copied model.

  • exclude (AbstractSetIntStr | MappingIntStrAny | None) – Optional set or mapping specifying which fields to exclude in the copied model.

  • update (Dict[str, Any] | None) – Optional dictionary of field-value pairs to override field values in the copied model.

  • deep (bool) – If True, the values of fields that are Pydantic models will be deep-copied.

Returns:

A copy of the model with included, excluded and updated fields as specified.

Return type:

Self

classmethod from_orm(obj)#
Parameters:

obj (Any)

Return type:

Self

classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)#
Parameters:
  • path (str | Path)

  • content_type (str | None)

  • encoding (str)

  • proto (DeprecatedParseProtocol | None)

  • allow_pickle (bool)

Return type:

Self

classmethod validate(value)#
Parameters:

value (Any)

Return type:

Self

Examples using coco_pipe.decoding.ExperimentConfig#

Basic Decoding: Classification and Model Verification

Basic Decoding: Classification and Model Verification