Skip to content

Update PortfolioRebalancing.ipynb with scikit-learn note - #793

Open
micpap25 wants to merge 1 commit into
eclipse-qrisp:mainfrom
micpap25:patch-1
Open

micpap25 wants to merge 1 commit into
eclipse-qrisp:mainfrom
micpap25:patch-1

Conversation

@micpap25

@micpap25 micpap25 commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Added a note to install scikit-learn to encourage users away from pip install sklearn.
Also, removed redundant imports in the same code block

Related Issues

Closes #633

Type of Change

  • Feature (new functionality)
  • Change Request (modification of existing functionality)
  • Bug Fix
  • Refactoring (no behavior change)
  • Performance improvement
  • Documentation
  • CI / Build

Breaking Change?

  • Yes
  • No

What was changed?

  • Added a comment at the end of a paragraph explaining why scikit-learn is used and telling users how to install it.
  • Removed two lines which were unused imports.

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review
  • I have added/updated tests (referencing issue Test-IDs)
  • All tests pass locally and in CI
  • I have updated the documentation
  • I have added a changelog entry to changelog-dev.rst
  • Breaking changes are documented with migration path

Reviewer Notes

Added a note to install `scikit-learn` to encourage users away from `pip install sklearn`.
"## Example implementation\n",
"\n",
"Let us now look at what these building blocks look like in working code example. We start off by defining the relevant parameters for a portfolio rebalancing instance, namely the number of assets and lots, the asset covariance matrix, the previous portfolio positions, the risk return factor, the normalized asset returns and the trading cost."
"Let us now look at what these building blocks look like in working code example. We start off by defining the relevant parameters for a portfolio rebalancing instance, namely the number of assets and lots, the asset covariance matrix, the previous portfolio positions, the risk return factor, the normalized asset returns and the trading cost. We will use scikit-learn (``pip install scikit-learn``) to normalize our data."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating the PR!

I wonder if it makes more sense to add a note box for this instead.

BTW have you gone through all the code blocks in this page and made sure everything works as expected? I cannot replicate the steps that made me recreate the original issue anymore because it was some time ago.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@purva-thakre See #795, the tutorial is broken regardless of these changes unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs tutorial refers to deprecated package sklearn

2 participants