Feat/early stopping feature implementation#75
Conversation
|
Thank you for opening this PR! Our automated system is currently verifying the PR requirements. |
Validation Successful!This pull request has been verified and linked to issue #39. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
Aamod007
left a comment
There was a problem hiding this comment.
Hi @Madhavi1108! Good work on the Rust implementation. Here are the issues:
What's Wrong
Critical:
- Python API (
etna/api.py) doesn't expose the newearly_stopping,patience,restore_bestparameters - These parameters aren't passed to the Rust call
- No tests for the new feature
- No documentation/docstring updates
Minor:
5. Missing newline at end of optimizer.rs
6. Silent failure if model restoration fails
What to Fix
- Add the 3 parameters to Python
train()method - Pass them through to Rust
- Write tests
- Update docs
The Rust code is solid, just needs Python integration!
Validation Successful!This pull request has been verified and linked to issue #39. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
|
Hi @Aamod007 , |
Aamod007
left a comment
There was a problem hiding this comment.
Everything is good, Excellent job !
|
This PR has been successfully merged. We appreciate your effort in improving the library and look forward to your future contributions to the Etsi AI ecosystem. |
Fixes
Closes: #39
Type of Change
Description
This PR adds native early stopping support to the Python API
Model.train()method.The following optional parameters are introduced:
early_stoppingpatiencerestore_bestThe training loop now tracks loss per epoch, maintains a best-loss checkpoint, and stops training when the loss does not improve for a configurable number of consecutive epochs.
When enabled, the model weights from the best-performing epoch are restored after training completes.
The default behavior remains unchanged when
early_stopping=False, ensuring full backward compatibility.How Has This Been Tested?
Screenshots / Logs
Contribution Context