Skip to content

Model Training

This section describes the process of training the deep learning model for the Store Sales - Deep Learning Solution project.

Overview

Model training involves fitting a neural network to the processed and feature-engineered sales data. The goal is to learn patterns and relationships that enable accurate sales forecasting.

Steps for Model Training

  1. Prepare the Training and Validation Data

  2. Ensure that the processed datasets (including features and targets) are available in the data/processed/ directory.

  3. The data should be split into training and validation sets to monitor model performance and prevent overfitting.

  4. Run the Training Script

You can train the model using the provided script:

python store-sales-DL/modeling/train.py

or, using the Makefile:

make train

  1. Training Details

  2. The script loads the processed data, builds the neural network, and trains it using the specified hyperparameters.

  3. Early stopping is used to halt training when validation loss stops improving.
  4. Model checkpoints and logs are saved for transparency and reproducibility.

  5. Output

  6. The best model is saved (e.g., as models/best_model.keras) for later inference.

  7. Training and validation metrics are displayed and can be logged for further analysis.

Notes

  • You can adjust hyperparameters (e.g., learning rate, batch size, number of epochs) in the training script to experiment with different configurations.
  • Ensure that the paths to data and model directories are correct in your environment.
  • For best results, monitor validation metrics to avoid overfitting.

For more details on model inference, see the Model Inference section.