pranjal-joshi / Screeni-py

A Python-based stock screener to find stocks with potential breakout probability from NSE India.
MIT License
552 stars 195 forks source link

Nifty model doesnt give same accuracy #191

Closed dopevog closed 1 year ago

dopevog commented 1 year ago

When I run experiment.ipynb the model does not yield the same accuracy as given when the code is first checked Before: image After: image

Could you please help me and explain why this is happening @pranjal-joshi ?

Also, how is the 128 rights and wrongs in the first one when the test size is only 40 days? Also is there way to further backtest the model for more than 40 days (like 100 days)?

dopevog commented 1 year ago

Hi it seems that the accuracy given is misleading as maybe you forgot restart the kernel before running the code, so the correct prediction value increased exponentially.

In reality, the accuracy is close to 57.5% - right @pranjal-joshi ?

pranjal-joshi commented 1 year ago

The ML model training has 3 sub datasets

  1. Training
  2. Testing
  3. Validation

The 100 days results you are watching must be the validation that was neither used for training, nor for testing.

Disclaimer: The training results are experimental and I don't claim whether the accuracy is high enough to take your trading decisions based on it.

dopevog commented 1 year ago

Could you say what the test and validation accuracy was for the current model v2? @pranjal-joshi

pranjal-joshi commented 1 year ago

No comments on absolute accuracy

Please refer to the notebook shared. This is the only experiment with ML so far.

dopevog commented 1 year ago

Please can you tell me where in the notebook I can find the accuracy?

I understand it is only for educational purposes @pranjal-joshi

pranjal-joshi commented 1 year ago

@dopevog

The following notebook will walk you through data preprocessing, feature engineering, training, validation and testing.

https://github.com/pranjal-joshi/Screeni-py/blob/main/src/ml/experiment.ipynb

dopevog commented 1 year ago

@pranjal-joshi could you tell me which cell blocks corespond to which part of the code please? Am facing difficulties trying to find it.

dopevog commented 1 year ago

@pranjal-joshi also, is this the same code that was used to make v2 model or was it diffirent?

dopevog commented 1 year ago

@pranjal-joshi please respond

pranjal-joshi commented 1 year ago

@pranjal-joshi also, is this the same code that was used to make v2 model or was it diffirent?

The same notebook is updated and used for v2 model

pranjal-joshi commented 1 year ago

@pranjal-joshi could you tell me which cell blocks corespond to which part of the code please? Am facing difficulties trying to find it.

The Jupyter notebooks are self explanatory 😅 I hope you have sufficient python/ML background to get started with this. If you have specific query, you can refer the piece of code from notebook and then we can discuss.

dopevog commented 1 year ago

I am actually pretty new to ML sorry @pranjal-joshi

github-actions[bot] commented 1 year ago

This Issue is marked as Stale due to Inactivity. This Issue will be Closed soon.