This project is packaged under src/mldl, so new course files should live inside that package rather than directly under src.
src/
`-- mldl/
|-- __init__.py
|-- logger.py
|-- exception.py
|-- utils.py
|-- components/
| |-- __init__.py
| |-- data_ingestion.py
| |-- data_transformation.py
| `-- model_trainer.py
`-- pipeline/
|-- __init__.py
|-- train_pipeline.py
`-- predict_pipeline.py
| File | Purpose |
|---|---|
logger.py |
Central logging setup so every module reports what it is doing. |
exception.py |
Custom error handling so failures are easier to trace and debug. |
utils.py |
Shared helper functions that do not belong to one specific pipeline stage. |
components/data_ingestion.py |
Reads raw data from a source and saves or returns it in a usable form. |
components/data_transformation.py |
Cleans data, encodes features, splits sets, and prepares inputs for training. |
components/model_trainer.py |
Trains the model and usually stores the trained artifact and metrics. |
pipeline/train_pipeline.py |
Orchestrates the end-to-end training flow by calling the components in order. |
pipeline/predict_pipeline.py |
Loads trained artifacts and runs predictions on new input data. |
Try to keep the project moving in this direction:
pipeline -> components -> shared helpers
That means:
pipeline/coordinates work.components/performs ML tasks.logger.py,exception.py, andutils.pysupport the rest of the code.
The diagram helps with orientation. Practice is what makes it stick.
The useful rhythm is:
- Read the chart.
- Create one file.
- State its responsibility in one sentence.
- Add the smallest working code.
- Run it and inspect what breaks.
That loop is better than copying a whole project structure without understanding the boundaries.