-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add argument to remove masking for heatmap in hcorr and print correlations to command line #1913
Add argument to remove masking for heatmap in hcorr and print correlations to command line #1913
Conversation
ea32c2f
to
b134019
Compare
@DidierRLopes @jmaslek can you review this PR? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is definitely a personal style thing, but I am not a fan of showing the whole correlation matrix.
I am fine with this being included behind an argparse argument that allows the user to specify whether they want the whole matrix or not
@jmaslek I've made some updates to address your feedback, so this is ready for another look. |
Thanks for adding the flag. The print is still off. We have a custom method I would also hide the console printing behind the |
@jmaslek is this sort of what you had in mind? This feels more unreadable to me than the printed values before unless I misunderstood your previous comment. |
Yeahhh that is what I had in mind. The actual terminal will be the limiting factor in how readable any table will be, so to keep with consistency across the code, can we keep the formatted table and then the user can change how many tickers they have loaded in. May be overkill, but I could also envision a case where we only show print pairs that meet a criteria (--min-corr .5 --max-corr .9) but that is out of the scope here |
@jmaslek got it, I'll go ahead and patch up the code I used to make the picture and get it submitted for review in a bit then.
That is an interesting idea. This would be helpful if it was integrated into some sort of scanner and also to look at variables beyond just the various parts of a candle - perhaps I would want to use it to scan for stocks that had a high volume correlation but had an inverse adjusted close correlation, as an example, to find a shortlist of stocks to dig into more. |
@jmaslek can you take a look now? |
Awesome! This looks great. The last thing I will request is that the documentation under website/content/terminal gets updated to reflect the new arguments! |
…kerr/OpenBBTerminal into stkerr-remove-heatmap-masking
Description
This PR adds an argument to the
hcorr
command to toggle displaying either the masked correlation matrix (as it does today) or a full, unmasked correlation matrix. The behavior defaults to off, which means the command will behave as it does today without the flga.This PR also prints the correlation matrix to the command line. This is helpful if someone is using the terminal over SSH or otherwise doesn't want to view the results only graphically. The print logic will wrap large matrices across multiple lines, rather than truncating the column.
This is after the change and using the flag:
How has this been tested?
Several tests were run with different tickers.
Pytest was run and all tests passed.
Checklist:
Others
pre-commit install
.pytest tests/...
.