# TP02 runnable solution

Requires Python 3.10+ and pandas. The successful run used the exact runtime versions recorded in `../../verification/runtime.json`.

From this directory:

```sh
python solution.py
python -m unittest -v
```

From any directory, run the full path to `solution.py`. Paths are anchored to the script, so the original `sample_data (2).csv` is read without changing it. Use `--input PATH` for another CSV. The CLI always saves its generated files here, within `_study/`.

Outputs are `cleaned_drop.csv`, `cleaned_mean.csv`, `cleaned_mode.csv`, and `pipeline_output.csv`. `output.txt` is the captured successful standard output; `execution.log` contains actual timing and logging output; `test_output.txt` records the behavioral checks. Elapsed timings depend on the machine and run.

Policies: mean and numeric normalization exclude `id`; mean fills numeric non-boolean measurements; mode fills all non-ID columns, resolving homogeneous ties with the first sorted pandas mode. All-missing columns stay missing and produce a warning. Text is trimmed and lowercased without converting missing entries to text. Deduplication compares whole rows, including IDs, and keeps the first. Min-max normalization maps observed constant columns to zero. The pipeline orders text standardization, full-row deduplication, then numeric normalization after mean filling.

The factory is a simple string-to-class factory. Python function decorators demonstrate wrapping; they are not a literal implementation of the GoF object Decorator class hierarchy. Abstract interfaces and `DataPipeline.run()` implement the requested Strategy and Template Method structure.

This is a one-dataset demonstration. A predictive workflow must fit preprocessing parameters on training data and reuse them on validation/test data; these classes do not implement a fitted estimator interface.
