How gtzjh/mymodels works
Main Components
• Data Input Layer: Represented by the CSV files found in the “data” directory. These datasets (housing, obesity, titanic) are sample inputs for different ML tasks.
• Pipeline Controller: The “mymodels/pipeline.py” file acts as the central orchestrator that ties together the workflow.
• Modular Components:
– Data Loader Module (mymodels/_data_loader.py): It is responsible for ingesting CSV data, handling the reading of files, and preprocessing (e.g., setting index columns).
– Encoder Module (mymodels/_encoder.py): This handles categorical encoding strategies (e.g., onehot, binary, target, etc.).
– Optimizer Module (mymodels/_optimizer.py): It leverages tools such as Optuna for hyperparameter tuning.
– Evaluator Module (mymodels/_evaluator.py): This module computes and outputs accuracy metrics, plots (ROC curves, scatter plots, etc.) for performance assessment.
– Explainer Module (mymodels/_explainer.py): Integrates SHAP for interpreting model predictions with summary and dependence plots.
– Models Module (mymodels/models.py): Encapsulates the various supported machine learning models (e.g., XGBoost, RandomForest, CatBoost, etc.).
• Runner Scripts: Files like “run_housing.py”, “run_obesity.py”, and “run_titanic.py” are entry points that set up the pipeline for different types of tasks (regression, multi-class classification, binary classification).
• Once data is loaded, it passes through pre-processing modules such as encoding (handled by the Encoder module).
• The refined dataset is then forwarded by the Pipeline to the Models module. The Optimizer module supports model selection and parameter tuning during this process.
• Once the model is trained, the Evaluator module assesses model performance and handles result outputting (including saving generated metrics and plots).
• In parallel or subsequently, the Explainer module uses SHAP to add interpretability to the model outputs.
• Finally, the overall orchestration is managed by the Pipeline controller, which ensures each module is invoked in the proper order.
Architectural Patterns and Integration
• The project is organized in a modular fashion where each component addresses a distinct part of the machine learning workflow. This separation of concerns is analogous to a layered or pipeline design.