Skip to content

Commit

Permalink
Updated Class Names
Browse files Browse the repository at this point in the history
  • Loading branch information
akwon31 committed May 28, 2020
1 parent 3c4410d commit d1be142
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 30 deletions.
40 changes: 20 additions & 20 deletions Online Portfolio Selection/Data Selection.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@
"metadata": {},
"outputs": [],
"source": [
"half_and_half_bah = BuyAndHold()\n",
"half_and_half_bah = BAH()\n",
"half_and_half_bah.allocate(stock_prices, weights=half_and_half)"
]
},
Expand Down Expand Up @@ -1985,7 +1985,7 @@
}
],
"source": [
"bah_best_stock = BuyAndHold()\n",
"bah_best_stock = BAH()\n",
"# buy_XLK represents a portfolio weight with 1 on XLK and 0 otherwise\n",
"buy_XLK = np.array(best_stock.all_weights.iloc[0])\n",
"bah_best_stock.allocate(stock_prices, weights=buy_XLK)\n",
Expand Down Expand Up @@ -3164,7 +3164,7 @@
}
],
"source": [
"monthly_bcrp = BestConstantRebalancedPortfolio()\n",
"monthly_bcrp = BCRP()\n",
"# 'M' represents monthly rebalancing\n",
"monthly_bcrp.allocate(stock_prices, resample_by='M')\n",
"print(monthly_bcrp.all_weights.iloc[0])"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,10 @@
"import plotly.offline as py\n",
"import plotly.graph_objs as go\n",
"import plotly.io as pio\n",
"from plotly.subplots import make_subplots \n",
"from mlfinlab.online_portfolio_selection import *\n",
"pio.renderers.default = \"svg\" # Toggle for GitHub rendering"
"from plotly.subplots import make_subplots\n",
"pio.renderers.default = \"svg\" # Toggle for GitHub rendering\n",
"\n",
"from mlfinlab.online_portfolio_selection import *"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,12 @@
"import pickle\n",
"import optuna\n",
"import matplotlib.pyplot as plt\n",
"from mlfinlab.online_portfolio_selection import *\n",
"import plotly.offline as py\n",
"import plotly.graph_objs as go\n",
"import plotly.io as pio\n",
"pio.renderers.default = \"svg\" # Toggle for GitHub rendering"
"pio.renderers.default = \"svg\" # Toggle for GitHub rendering\n",
"\n",
"from mlfinlab.online_portfolio_selection import *"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,9 @@
"import plotly.graph_objs as go\n",
"import plotly.io as pio\n",
"from plotly.subplots import make_subplots \n",
"from mlfinlab.online_portfolio_selection import *\n",
"pio.renderers.default = \"svg\" # Toggle for GitHub rendering"
"pio.renderers.default = \"svg\" # Toggle for GitHub rendering\n",
"\n",
"from mlfinlab.online_portfolio_selection import *"
]
},
{
Expand Down

0 comments on commit d1be142

Please sign in to comment.