Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"source": [
"## 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.

]
},
{
Expand All @@ -222,7 +222,6 @@
"outputs": [],
"source": [
"# imports\n",
"import sklearn\n",
"from sklearn import preprocessing # Add explicit import for preprocessing\n",
"import numpy as np\n",
"\n",
Expand Down Expand Up @@ -294,7 +293,6 @@
" 0.010873,\n",
"]\n",
"mu = [data1[i] for i in range(len(data1)) if i % 2 == 0]\n",
"from sklearn import preprocessing\n",
"\n",
"mu_array = np.array(mu)\n",
"# this is the normalized asset return array\n",
Expand Down