Skip to content

Added transfer learning to make predictinos and generating response f…#5

Merged
ArshdeepSingh728281 merged 1 commit intoOpen-Source-Chandigarh:mainfrom
Lakshya-sketch:feature/Added_Transfer_Learning
Oct 23, 2025
Merged

Added transfer learning to make predictinos and generating response f…#5
ArshdeepSingh728281 merged 1 commit intoOpen-Source-Chandigarh:mainfrom
Lakshya-sketch:feature/Added_Transfer_Learning

Conversation

@Lakshya-sketch
Copy link
Copy Markdown
Contributor

Transfer Learning Implementation

Summary

Reduces prediction time from 2-5 minutes to 4 seconds (75x speedup) using transfer learning.

Changes

New Files:

  • pythonModel/Train_Base_Model.py - Trains base model on 9 diverse stocks
  • pythonModel/models/.gitignore - Excludes weight files
  • pythonModel/models/README.md - Setup documentation

Modified:

  • pythonModel/pipline.py - Loads pre-trained weights, freezes LSTM layers, reduces epochs from 30 to 5

Performance

Metric Before After
Training time 2-5 min 4 sec
Epochs 30 5
API response 200 OK 200 OK

Training Output

Expand logs

Setup

cd pythonModel
python Train_Base_Model.py

Creates base_stock_weights.weights.h5. Automatically used when present, falls back to full training if missing.

Testing

curl "http://localhost:8000/predict?ticker=INFY.NS&symbol=INFY&period=1mo&interval=1h&days_to_fetch=3"

Returns valid JSON in 4-10 seconds.

Compatibility

  • Backward compatible
  • No breaking changes
  • Works with/without base weights

@ArshdeepSingh728281 ArshdeepSingh728281 merged commit 9e52ee1 into Open-Source-Chandigarh:main Oct 23, 2025
1 check failed
@ArshdeepSingh728281 ArshdeepSingh728281 added hacktoberfest-accepted hacktoberfest-accepted: Marks a PR as accepted for Hacktoberfest, counting toward contributions. hard Need to have a full understanding of the workflow. Excellent work! labels Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted hacktoberfest-accepted: Marks a PR as accepted for Hacktoberfest, counting toward contributions. hard Need to have a full understanding of the workflow. Excellent work!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants