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

[Feature] Add Chart To econometrics.correlation_matrix #6750

Merged
merged 6 commits into from
Oct 11, 2024

Conversation

deeleeramone
Copy link
Contributor

@deeleeramone deeleeramone commented Oct 8, 2024

  1. Why?:

    • More charts are more better.
    • obb.econometrics.correlation_matrix was missing the "method" parameter.
  2. What?:

    • Adds a visualization for obb.econometrics.correlation_matrix
    • Adds a parameter for the correlation method - ["pearson", "kendall", "spearman"]
    • Adds a Charting method, create_correlation_matrix, to create the chart from external data.
  3. Impact:

    • Enhances the charting library with a traditional, diagonal, masked, correlation matrix heatmap.
    • API-compatible chart.
  4. Testing Done:

    • Unit and integration tests.

Both blocks should create the same chart, except the second will be sorted alphabetically.

from openbb import obb

symbols = "SPY,NVDA,AAPL,MSFT,GOOG,PLTR,TSLA".split(",")
data = (
    obb.equity.price.historical(symbols)
    .to_df()
    .pivot(
        values="close",
        columns="symbol",
    )
).filter(items=symbols, axis=1)
corr = obb.econometrics.correlation_matrix(data=data, method="pearson", chart=True)
corr.show()
Screenshot 2024-10-07 at 10 27 57 PM
from openbb import obb

data = obb.equity.price.historical("SPY,NVDA,AAPL,MSFT,GOOG,PLTR,TSLA", provider="yfinance")
data.charting.create_correlation_matrix(data.results).show()
Screenshot 2024-10-07 at 10 45 51 PM

@deeleeramone deeleeramone added enhancement Enhancement platform OpenBB Platform v4 PRs for v4 labels Oct 8, 2024
@IgorWounds IgorWounds added this pull request to the merge queue Oct 11, 2024
Merged via the queue into develop with commit c58b567 Oct 11, 2024
10 checks passed
@piiq piiq deleted the feature/corr-matrix-chart branch October 18, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants