Train Your Model¶
Step-by-step guide to training your agent.
Before Training¶
Ensure you have:
- ✅ Configuration file (config.yaml)
- ✅ Training data (data/train.csv)
- ✅ Test data (data/test.csv)
Start Training¶
iovalence train --config config.yaml
Or with options:
iovalence train \
--config config.yaml \
--epochs 30 \
--batch-size 32 \
--gpu # Use GPU if available
Monitor Training¶
Training output:
Starting training...
Epoch 1/20: loss=0.542, acc=0.78, val_loss=0.498, val_acc=0.82
Epoch 2/20: loss=0.412, acc=0.85, val_loss=0.401, val_acc=0.87
Epoch 3/20: loss=0.321, acc=0.89, val_loss=0.315, val_acc=0.91
...
Training completed!
Best model saved: models/best_model.pkl
Training time: 2 minutes 34 seconds
Training Metrics¶
- loss: How wrong predictions are (lower is better)
- acc: Training accuracy (higher is better)
- val_loss: Validation loss (should decrease)
- val_acc: Validation accuracy (should increase)
Troubleshooting Training¶
Low Accuracy¶
# Try:
training:
epochs: 50 # More training
learning_rate: 0.01 # Adjust rate
batch_size: 16 # Smaller batches
Overfitting¶
# Try:
training:
dropout: 0.5 # More regularization
epochs: 10 # Fewer epochs
early_stopping: true
patience: 3
Training Too Slow¶
# Try:
training:
batch_size: 128 # Larger batches
epochs: 10 # Fewer epochs
Save & Load Models¶
Save Trained Model¶
iovalence save --model models/best_model.pkl --tag v1.0
Load Model¶
iovalence load --model models/best_model.pkl