Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix $volume normalization issue #792

Merged
merged 4 commits into from
Jan 1, 2022

Conversation

2young-2simple-sometimes-naive
Copy link
Contributor

Fix: #765

Description

change $volume to $volume+1e-12 such that low volume stocks will not create infinity in features.

Motivation and Context

https://github.com//issues/765 $volume creates infinity for low volume stocks.

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@you-n-g
Copy link
Collaborator

you-n-g commented Jan 1, 2022

@2young-2simple-sometimes-naive Thanks for your contribution!
Could you help to format your code?
Thanks!
https://github.com/microsoft/qlib/blob/main/docs/developer/code_standard.rst#continuous-integration

@you-n-g
Copy link
Collaborator

you-n-g commented Jan 1, 2022

Besides, will your results change significantly if you add this patch?

@you-n-g
Copy link
Collaborator

you-n-g commented Jan 1, 2022

The format errors are listed in the CI output.
https://github.com/microsoft/qlib/runs/4678866110?check_suite_focus=true#step:4:170

@2young-2simple-sometimes-naive
Copy link
Contributor Author

Besides, will your results change significantly if you add this patch?

Depends on the selection of stocks. My strategy has a lot of low volumes stocks, and the fix does not change the IC/RIC significantly. It turns out the volume info is not that important in my stock pool.

@you-n-g
Copy link
Collaborator

you-n-g commented Jan 1, 2022

It looks great to me.
Thanks so much!

@you-n-g you-n-g merged commit e76b409 into microsoft:main Jan 1, 2022
@you-n-g you-n-g added the bug Something isn't working label Jan 12, 2022
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
* Fix $volume normalization issue

Fix: microsoft#765

* black formatting

black formatting

* black formatting

black formatting

* black formatting

black formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve normalization of volume
2 participants