{"id":1656,"date":"2021-05-17T08:27:42","date_gmt":"2021-05-17T08:27:42","guid":{"rendered":"http:\/\/lucylabs.gatech.edu\/ml4t\/?page_id=1656"},"modified":"2021-05-17T12:48:31","modified_gmt":"2021-05-17T12:48:31","slug":"project-2","status":"publish","type":"page","link":"https:\/\/lucylabs.gatech.edu\/ml4t\/summer2021\/project-2\/","title":{"rendered":"Project 2"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_font=&#8221;|700||on|||||&#8221;]<\/p>\n<h1 style=\"text-align: center;\">Project 2: Optimize Something<\/h1>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221;]<\/p>\n<h2>Revisions<\/h2>\n<p><span>This assignment is subject to change up until 3 weeks prior to the due date. We do not anticipate changes; any changes will be logged in this section.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221;]<\/p>\n<h2>Overview<\/h2>\n<p><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW61723103 BCX4\"><span class=\"NormalTextRun SCXW61723103 BCX4\">In this project, you will write software that<\/span><span class=\"NormalTextRun SCXW61723103 BCX4\"> evaluates and prepares portfolio metrics. <\/span><span class=\"NormalTextRun SCXW61723103 BCX4\">You will submit the code for the project <\/span><span class=\"NormalTextRun SCXW61723103 BCX4\">in <\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW61723103 BCX4\">Gradescope<\/span><span class=\"NormalTextRun SCXW61723103 BCX4\"> SUBMISSION. You will also submit to Canvas a <\/span><span class=\"NormalTextRun SCXW61723103 BCX4\">chart as a 1-page report that <\/span><span class=\"NormalTextRun SCXW61723103 BCX4\">compares<\/span><span class=\"NormalTextRun SCXW61723103 BCX4\"> <\/span><span class=\"NormalTextRun SCXW61723103 BCX4\">two normalized portfolios<\/span><span class=\"NormalTextRun SCXW61723103 BCX4\">.<\/span><\/span><span class=\"EOP SCXW61723103 BCX4\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221;]<\/p>\n<h2>About The Project<\/h2>\n<p><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW237140177 BCX4\"><span class=\"NormalTextRun SCXW237140177 BCX4\">Revise the optimization.py code <\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">to return<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\"> several portfolio statistics: stock allocations (<\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW237140177 BCX4\">allocs<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">), cumulative return (<\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW237140177 BCX4\">cr<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">), average daily return (<\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW237140177 BCX4\">adr<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">), stan<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">da<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">rd<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\"> deviation of daily returns (<\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW237140177 BCX4\">sddr<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">), and Sharpe ratio (<\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW237140177 BCX4\">sr<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">). This project <\/span><span class=\"NormalTextRun SCXW237140177 BCX4\">builds upon what you learned about portfolio performance metrics and <\/span><span class=\"NormalTextRun CommentStart SCXW237140177 BCX4\">optimizers<\/span><span class=\"NormalTextRun SCXW237140177 BCX4\"> to optimize a portfolio. That means that you will find how much of a portfolio\u2019s funds should be allocated to each stock to optimize its performance. While a portfolio can be optimized for many different metrics, in this version of the assignment we will maximize the Sharpe Ratio. You will use the data cleansing techniques introduced in the course lectures.<\/span><\/span><span class=\"EOP SCXW237140177 BCX4\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h2><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW163247658 BCX4\"><span class=\"NormalTextRun SCXW163247658 BCX4\">Your Implementation<\/span><\/span><span class=\"EOP SCXW163247658 BCX4\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><span class=\"EOP SCXW163247658 BCX4\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><\/span><\/h2>\n<p><b><span data-contrast=\"auto\">Implement the optimize_portfolio() function<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The optimization.py file must implement this <\/span><a href=\"http:\/\/lucylabs.gatech.edu\/ml4t\/summer2021\/project-2-doc\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">API specification<\/span><\/a><span data-contrast=\"auto\"> (including the default arguments).<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Revise the code to implement a Python function named optimize_portfolio() in the file optimization.py that can find the optimal allocations for a given set of stocks. You should optimize for maximum Sharpe Ratio taking long positions only.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The function should accept as input a list of symbols as well as start and end dates and return a list of floats as a one-dimensional Numpy array that represents the allocations to each of the equities. You can take advantage of routines developed in the optional assess portfolio (<\/span><i><span data-contrast=\"auto\">see note under<\/span><\/i> <i><span data-contrast=\"auto\">Starter Code<\/span><\/i><span data-contrast=\"auto\">) project to compute daily portfolio value and statistics, and then by using cut-and-paste to move the code from the project for the necessary functions into optimization.py.\u00a0 Otherwise, you will need to create the functions within optimization.py.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You are given the following inputs for optimizing a portfolio:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"12\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">A date range to select the historical data to use (specified by a start and end date)<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"12\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Symbols for equities (e.g., GOOG, AAPL, GLD, XOM). Note: You should support any symbol in the data directory. Your code should support any number of assets &gt;= 2. Don\u2019t hardcode 4 as the number of assets.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Your goal is to find allocations to the symbols that optimize the criterion given above. Assume 252 trading days in a year and a risk-free return of 0.0 per day.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You will produce a single chart, as a .png file called \u201cFigure1.png\u201d, comparing the optimal normalized portfolio with SPY using the following portfolio parameters:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"16\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Start Date: 2008-06-01, End Date: 2009-06-01, Symbols: [\u2018IBM\u2019, \u2018X\u2019, \u2018GLD\u2019, \u2018JPM\u2019].<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">While four (4) symbols are used in the portfolio associated with Figure 1, the implementation must be robust enough to handle any number of symbols.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The chart must be correct, be properly titled, have appropriate axis labels, use consistent axis ranges, and have legends. You should use python\u2019s Matplotlib library.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The implementation will be evaluated using 10 test cases that will validate that the sum of the allocations to 1.0 (with a -\/+ 0.2 tolerance), the individual allocations range from 0.0 to 1.0 (with a -\/+ 0.2 tolerance), and that the standard deviation is correct (within 5% of the reference implementation).<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><\/span><\/p>\n<p><b><span data-contrast=\"auto\">Technical Requirements<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Use only the functions provided in the util.py file for reading historical stock data provided in ..\/data folder. Do NOT modify, copy, or move the util.py file or its functions.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Your code must run in less than 5 seconds per test case in the university-provided Gradescope environment.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">A random seed may not be set for this assignment.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Watermarked Charts (i.e., where the GT Username appears over the lines) can be shared in the designated pinned (e.g., \u201cProject 2- Student Charts\u201d) thread alone. Charts presented in reports or submitted for grading must not contain watermarks.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Example<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The following example illustrates how the optimize_portfolio function will be called:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][et_pb_dmb_code_snippet code=&#8221;aW1wb3J0IGRhdGV0aW1lIGFzIGR0IAphbGxvY3MsIGNyLCBhZHIsIHNkZHIsIHNyID0gIAogICAgb3B0aW1pemVfcG9ydGZvbGlvKHNkPWR0LmRhdGV0aW1lKDIwMDgsMSwxKSwgZWQ9ZHQuZGF0ZXRpbWUoMjAwOSwxLDEpLCAgCiAgICBzeW1zPVsnR09PRycsJ0FBUEwnLCdHTEQnLCdYT00nXSwgZ2VuX3Bsb3Q9RmFsc2UpIA==&#8221; language=&#8221;python&#8221; _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]aW1wb3J0IGRhdGV0aW1lIGFzIGR0IAphbGxvY3MsIGNyLCBhZHIsIHNkZHIsIHNyID0gIAogICAgb3B0aW1pemVfcG9ydGZvbGlvKHNkPWR0LmRhdGV0aW1lKDIwMDgsMSwxKSwgZWQ9ZHQuZGF0ZXRpbWUoMjAwOSwxLDEpLCAgCiAgICBzeW1zPVsnR09PRycsJ0FBUEwnLCdHTEQnLCdYT00nXSwgZ2VuX3Bsb3Q9RmFsc2UpIA==[\/et_pb_dmb_code_snippet][et_pb_text _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<p><span data-contrast=\"auto\">Where the returned output is:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"14\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">allocs: A 1-d NumPy NDArray of allocations to the stocks. All the allocations must be between 0.0 and 1.0 and they must sum to 1.0. Some of the allocations may be 0.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"14\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">cr: Cumulative return<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"14\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">adr: Average daily return<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"14\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">sddr: Standard deviation of daily return<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"14\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">sr: Sharpe ratio<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">The input parameters are:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"15\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">sd: A DateTime object that represents the start date<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"15\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">ed: A DateTime object that represents the end date<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"15\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">syms: A list of symbols that make up the portfolio (note that your code should support any symbol in the data directory)<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"15\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">gen_plot: If True, optionally create a plot named plot.png. This may be useful for any tests you develop where you want to print output to the console. The Autograder will always call your code with gen_plot = False.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">An example chart that you might create for assessing your optimizer.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;http:\/\/lucylabs.gatech.edu\/ml4t\/wp-content\/uploads\/2021\/05\/p2examplechart.png&#8221; title_text=&#8221;p2examplechart&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<p><b><span data-contrast=\"auto\">Suggestions<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"17\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Refer to comments in the provided helper code for pointers on implementation. In order to specify bounds and constraints when using the scipy.optmize module, you\u2019ll need to use a special syntax explained here: http:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.optimize.minimize.html<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"17\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">For bounds, you simply need to pass in a sequence of 2-tuples (&lt;low&gt;, &lt;high&gt;). Just remember that you need to supply as many tuples as the number of stocks in your portfolio.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"17\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">For constraints, it\u2019s a little tricky. You need to pass in a sequence of dicts (dictionaries), one dictionary per constraint. Each dictionary must specify the type of constraint (&#8216;eq&#8217; for equality, or &#8216;ineq&#8217; for inequality), and a function that returns 0 only when the input satisfies the constraint (this is the same input that is supplied to your evaluation function). E.g. to constrain the sum of all values in the input array to be less than 50, you could pass in the following (lambdas are just anonymous functions defined on the spot):<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">constraints = ({ &#8216;type&#8217;: &#8216;ineq&#8217;, &#8216;fun&#8217;: lambda inputs: 50.0 &#8211; np.sum(inputs) })<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"18\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Use a uniform allocation of 1\/n to each of the n assets as your initial guess.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<h2>TECHNICAL REQUIREMENTS<\/h2>\n<p><span data-contrast=\"auto\">The optimization.py file must implement this <\/span><a href=\"http:\/\/lucylabs.gatech.edu\/ml4t\/summer2021\/project-2-doc\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">API specification<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"><\/span><\/p>\n<h3><b><span data-contrast=\"auto\">Starter Code<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">To make it easier to get started on the project and focus on the concepts involved, you will be given a starter framework. This framework assumes you have already set up the <\/span><a href=\"http:\/\/lucylabs.gatech.edu\/ml4t\/summer2021\/local-environment\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">local environment<\/span><\/a><span data-contrast=\"auto\"> and <\/span><a href=\"http:\/\/lucylabs.gatech.edu\/ml4t\/summer2021\/software-setup\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">ML4T Software<\/span><\/a><span data-contrast=\"auto\">. The framework for Project 1 can be obtained from:\u00a0\u00a0<\/span><a href=\"https:\/\/www.dropbox.com\/s\/o7bn94b3grsd11o\/optimize_something_2021Sum.zip?dl=1\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">Optimize_Something2021Summer.zip<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Extract its contents into the base directory (e.g., ML4T_2021Summer). This will add a new folder called \u201coptimize_something\u201d to the directory structure.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;http:\/\/lucylabs.gatech.edu\/ml4t\/wp-content\/uploads\/2021\/05\/optimize_structure.png&#8221; title_text=&#8221;optimize_structure&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<p><span data-contrast=\"auto\">Within the optimize_something folder are two files: optimization.py, and grade_optimization.py. You will modify the optimization.py file to implement the necessary functionality for this assignment. You must implement the optimize_portfolio() function. The existing code in the optimization.py file is best thought of as \u201cstub\u201d or \u201cstarter\u201d code that may contain ideas for functions and methods that might be used in your implementation. This file must remain and run from within the optimize_something directory using the following command:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][et_pb_dmb_code_snippet code=&#8221;UFlUSE9OUEFUSD0uLi86LiBweXRob24gb3B0aW1pemF0aW9uLnB5IA==&#8221; _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]UFlUSE9OUEFUSD0uLi86LiBweXRob24gb3B0aW1pemF0aW9uLnB5IA==[\/et_pb_dmb_code_snippet][et_pb_text _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<p><i><span data-contrast=\"auto\">Note: You can leverage the functions in the now deprecated (no longer assigned) <\/span><\/i><a href=\"https:\/\/www.dropbox.com\/s\/84bn3ov4abin5tc\/assess_portfolio_2021Sum.zip?dl=1\" target=\"_blank\" rel=\"noopener\"><i><span data-contrast=\"none\">assess portfolio<\/span><\/i><\/a><i><span data-contrast=\"auto\"> project that assessed the value of a portfolio with a given set of allocations. This is given only as a potential tool to use while completing the project to ensure you have your portfolio statistic calculations correct. Note that this code was writing for Python 2.7 and may need to be updated to run with Python 3.6.<\/span><\/i><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221;]<\/p>\n<h2>Contents of Report<\/h2>\n<p><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW259900328 BCX4\"><span class=\"NormalTextRun SCXW259900328 BCX4\">The <\/span><\/span><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW259900328 BCX4\"><span class=\"NormalTextRun SCXW259900328 BCX4\">report.pdf<\/span><\/span><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW259900328 BCX4\"><span class=\"NormalTextRun SCXW259900328 BCX4\"> file will consist of a single page that contains the chart generated by <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">your implementation. The c<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">harts must be generated by the code and saved to <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">a <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">file. <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">It <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">can be imported (without additional post-processing) into the report document. <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">The chart will be evaluated on its correctness<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\"> (i.e., shape, scale, <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">range,<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\"> <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">normalizes lines<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">, current number of lines<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">)<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\"> and <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">textual completeness (i.e., appropriate title, legends<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">, axis labels<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">).<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\"> All textual elements must be readable <\/span><span class=\"NormalTextRun SCXW259900328 BCX4\">and<\/span><span class=\"NormalTextRun SCXW259900328 BCX4\"> non-overlapping.<\/span><\/span><span class=\"EOP SCXW259900328 BCX4\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221;]<\/p>\n<h2>Testing<\/h2>\n<p><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW220281501 BCX4\"><span class=\"NormalTextRun SCXW220281501 BCX4\">To test your code, we will<\/span><span class=\"NormalTextRun SCXW220281501 BCX4\"> call the <\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW220281501 BCX4\">optimize_<\/span><span class=\"NormalTextRun SpellingErrorV2 SCXW220281501 BCX4\">portfolio<\/span><span class=\"NormalTextRun SCXW220281501 BCX4\">(<\/span><span class=\"NormalTextRun SCXW220281501 BCX4\">) <\/span><span class=\"NormalTextRun SCXW220281501 BCX4\">function <\/span><span class=\"NormalTextRun SCXW220281501 BCX4\">only. <\/span><span class=\"NormalTextRun SCXW220281501 BCX4\">You are encouraged to perform any tests necessary to <\/span><span class=\"NormalTextRun SCXW220281501 BCX4\">build<\/span><span class=\"NormalTextRun SCXW220281501 BCX4\"> confidence that the code will run properly when submitted for grading and will produce the required results. To run and test that the file will run from within the <\/span><span class=\"NormalTextRun SpellingErrorV2 SpellingErrorHighlight SCXW220281501 BCX4\">optimize_something<\/span><span class=\"NormalTextRun SCXW220281501 BCX4\"> directory, use the command given above at the command prompt from within the optimize_something directory:<\/span><\/span><span class=\"EOP SCXW220281501 BCX4\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][et_pb_dmb_code_snippet code=&#8221;UFlUSE9OUEFUSD0uLi86LiBweXRob24gb3B0aW1pemF0aW9uLnB5IA==&#8221; _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]UFlUSE9OUEFUSD0uLi86LiBweXRob24gb3B0aW1pemF0aW9uLnB5IA==[\/et_pb_dmb_code_snippet][et_pb_text _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<p><i><span data-contrast=\"auto\">Note: Once submitted for grading, we will use the above command to call the \u201c__main__\u201d section only. The program should run in its entirety and produce the necessary output and chart.<\/span><\/i><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Additionally, we provide the grade_optimization.py file that can be used for your tests. This file is the same script that will be run when the code is submitted to GradeScope TESTING. This file is not a complete test suite and does not match the more stringent private grader that is used in Gradescope SUBMISSION. To run and test that the file will run from within the optimize_something directory, use the command:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][et_pb_dmb_code_snippet code=&#8221;UFlUSE9OUEFUSD0uLi86LiBweXRob24gZ3JhZGVfb3B0aW1pemF0aW9uLnB5IA==&#8221; _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]UFlUSE9OUEFUSD0uLi86LiBweXRob24gZ3JhZGVfb3B0aW1pemF0aW9uLnB5IA==[\/et_pb_dmb_code_snippet][et_pb_text _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<p><span data-contrast=\"auto\">You are encouraged to submit your files to Gradescope TESTING, where some basic pre-validation tests will be performed against the code. Gradescope TESTING does not grade your assignment. No credit will be given for coding assignment that do not pass this pre-validation.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You are allowed <\/span><b><span data-contrast=\"auto\">unlimited<\/span><\/b><span data-contrast=\"auto\"> resubmissions to Gradescope <\/span><b><span data-contrast=\"auto\">TESTING<\/span><\/b><span data-contrast=\"auto\">. Please refer to the <\/span><a href=\"http:\/\/lucylabs.gatech.edu\/ml4t\/summer2021\/gradescope\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">Gradescope Instructions<\/span><\/a><span data-contrast=\"auto\"> for more information.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221;]<\/p>\n<h2><span data-contrast=\"auto\" xml:lang=\"EN-US\" lang=\"EN-US\" class=\"TextRun SCXW13267122 BCX4\"><span class=\"NormalTextRun SCXW13267122 BCX4\">Submission Instructions<\/span><\/span><span class=\"EOP SCXW13267122 BCX4\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><b><span data-contrast=\"auto\">This is an individual assignment<\/span><\/b><span data-contrast=\"auto\">. All work you submit should be your own. Make sure to cite any sources you reference and use quotes and in-line citations to mark any direct quotes.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Late work is not accepted without advanced agreement except in cases of medical or family emergencies. In the case of such an emergency, please <\/span><a href=\"https:\/\/gatech-advocate.symplicity.com\/care_report\/index.php\/pid986879?\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">contact the Dean of Students<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><b><span data-contrast=\"auto\">Report Submission<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Complete your assignment using the <\/span><a href=\"https:\/\/drive.google.com\/drive\/folders\/1xDYIomn9e9FxbIeFcsclSbXHTtHROD1j\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">JDF format<\/span><\/a><span data-contrast=\"auto\">, then save your submission as a PDF. The report is to be submitted as <\/span><b><span data-contrast=\"auto\">report.pdf. <\/span><\/b><span data-contrast=\"auto\">None of the JDF sections identified in the template are required for this assignment. Assignments should be submitted to the corresponding assignment submission page in Canvas. You should submit a single PDF for this assignment. Please submit the following file to Canvas in PDF format only:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"8\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><b><span data-contrast=\"auto\">report.pdf<\/span><\/b><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Do not submit any other files. The chart must be included in the report, not submitted as a separate file. Also note that when we run your submitted code, it should generate the chart. Not submitting a report will result in a penalty.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You are allowed unlimited submissions of the report.pdf file to Canvas.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><b><span data-contrast=\"auto\">Code Submission<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">This class uses Gradescope, a server-side auto-grader, to evaluate your code submission. No credit will be given for code that does not run in this environment and students are encouraged to leverage Gradescope TESTING prior to submitting an assignment for grading.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Please submit the following file to Gradescope <\/span><span data-contrast=\"auto\">SUBMISSION<\/span><span data-contrast=\"auto\">:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><b><span data-contrast=\"auto\">optimization.py<\/span><\/b><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Do not submit any other files.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You are allowed a MAXIMUM of three (3) code submissions to Gradescope SUBMISSION.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.4.5&#8243;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.4.5&#8243;][et_pb_text _builder_version=&#8221;4.9.4&#8243; header_2_font=&#8221;|||on|on||||&#8221;]<\/p>\n<h2><b><span data-contrast=\"auto\">Grading Information<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">Your report is worth 20% of your grade. As such, it will be graded on a 20-point scale coinciding with a rubric design to mirror the questions above. Make sure to answer those questions. The submitted code (which is worth 80% of your grade) is run as a batch job after the project deadline. The code will be graded using a rubric design to mirror the implantation details above, where each of the 10 implementation test cases is worth 8 points. Deductions will be applied for unmet implementation requirements or code that fails to run.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">We do not provide an explicit set timeline for returning grades, except that everything will be graded before the institute deadline (end of the term). As will be the case throughout the term, the grading team will work as quickly as possible to provide project feedback and grades. Once grades are released, any grade related matters must follow the <\/span><a href=\"http:\/\/lucylabs.gatech.edu\/ml4t\/summer2021\/assignment-follow-up\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">Assignment Follow-Up<\/span><\/a><span data-contrast=\"auto\"> guidelines and process.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><b><span data-contrast=\"auto\">Rubric<\/span><\/b><\/h2>\n<p><b><span data-contrast=\"auto\">Report [20 points]<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Each chart line (SPY\/Portfolio is worth 10 points each)<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">No chart or chart is total nonsense. (-20 points, if incorrect).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Chart is wrong shape (e.g., wrong time period) (-10 point if incorrect).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Partly wrong shape (chart begins correctly but midway or after is incorrect) (-5 points if incorrect).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">Chart not normalized or -5 chart data scale substantially wrong (e.g., right shape that is normalized to 1 but the max\/end values are wrong \u2013 for example, 3.5 instead of 2.5). (-10 points if incorrect).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Missing required data series (did not plot one of portfolio or SPY lines) (-10 points per case, if incorrect).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Chart labels\/text\/legend unreadable (e.g., too small, labels overlap a lot) or missing. (-2 points per each case, if missing or incorrect).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Min score: 0.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">Code<\/span><\/b><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"6\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">Does the code generate the appropriate chart written to a .png file? (-10 points).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"6\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Does the code create charts that are displayed on the screen or in a window when the code is run? (-10 points for each chart).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">Auto-Grader [80 points]<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">We will test your code against 10 cases (8 points per case). Each case will be deemed \u201ccorrect\u201d if:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"6\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">sum(allocations) = 1.0 +- 0.02 (2 points)<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"6\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Each allocation is between 0 and 1.0 +- 0.02 (negative allocations are allowed if they are very small) (2 points)<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"6\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Standard deviation of daily return of the allocated portfolio is within 5% of reference solution or lower (4 points)<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"6\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Minimum score: 0.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">There is no partial credit for the per-test-case points breakdown above if outside the threshold. If you are within the threshold, you get the point allocation, outside the threshold you get 0.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Allowed<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">All libraries provided in the Local Environment setup page.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">All standard Python libraries (except the os library, which is prohibited)<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Code provided by the instructor or allowed by the instructor to be shared.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">Prohibited<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Use of the Python os library\/module.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">Use of global variables.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Code that results in a window or chart being displayed (an example of which is matplotlib\u2019s plt.show() function)<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Code that creates any directories<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Any code that you did not write yourself (except for properly cited code provided by the instructor).<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"4\" data-aria-level=\"1\"><span data-contrast=\"auto\">Absolute import statements, such as: <\/span><i><span data-contrast=\"auto\">from folder_name import martingale<\/span><\/i><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"5\" data-aria-level=\"1\"><span data-contrast=\"auto\">Any libraries not included as part of the Local Environment as provided on the Local Environment Setup page.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"auto\">Editing (i.e., adding, changing or deleting) above the line that reads: \u201c&#8212;&#8211;do not edit anything above this line&#8212;&#8220;.\u00a0<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"auto\">Sharing of <\/span><span data-contrast=\"none\">tables<\/span><span data-contrast=\"auto\"> and <\/span><span data-contrast=\"none\">statistics<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"7\" aria-setsize=\"-1\" data-aria-posinset=\"3\" data-aria-level=\"1\"><span data-contrast=\"auto\">Camels and other dromedaries.<\/span><span data-ccp-props=\"{&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<ul><\/ul>\n<h2><b><span data-contrast=\"auto\">Relevant Resources<\/span><\/b><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">You may find the following resources useful in completing the project or in providing an in-depth discussion of the material.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Sharpe (1994), <\/span><a href=\"https:\/\/web.stanford.edu\/~wfsharpe\/art\/sr\/sr.htm\" target=\"_blank\" rel=\"noopener\">The Sharpe Ratio<\/a><\/p>\n<p><a href=\"https:\/\/www.dropbox.com\/s\/84bn3ov4abin5tc\/assess_portfolio_2021Sum.zip?dl=1\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">(Deprecated) Assess Portfolio Files<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">SciPy.org, <\/span><a href=\"https:\/\/docs.scipy.org\/doc\/scipy-1.2.1\/reference\/generated\/scipy.optimize.minimize.html\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">scipy.optimize.minimize<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">TutorialsPoint.com, <\/span><a href=\"https:\/\/www.tutorialspoint.com\/What-are-default-arguments-in-python\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">What are default arguments in Python?<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Hilpisch (2014 \u2013 1<\/span><span data-contrast=\"auto\">st<\/span><span data-contrast=\"auto\"> Edition or 2018 \u2013 2<\/span><span data-contrast=\"auto\">nd<\/span><span data-contrast=\"auto\"> Edition), <\/span><a href=\"https:\/\/learning.oreilly.com\/library\/view\/python-for-finance\/9781492024323\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">Python for Finance<\/span><\/a><span data-contrast=\"auto\"> (Chapter 9 \u2013 Mathematical Tools)<\/span><\/p>\n<p><span data-contrast=\"auto\">Martelli, A. Ravenscroft, and S. Holden (2017), <\/span><a href=\"https:\/\/learning.oreilly.com\/library\/view\/python-in-a\/9781491913833\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">Python in a Nutshell, 3<\/span><span data-contrast=\"none\">rd<\/span><span data-contrast=\"none\"> Edition<\/span><\/a><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Project 2: Optimize SomethingRevisions This assignment is subject to change up until 3 weeks prior to the due date. We do not anticipate changes; any changes will be logged in this section.Overview In this project, you will write software that evaluates and prepares portfolio metrics. You will submit the code for the project in Gradescope [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1607,"menu_order":8,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<!-- wp:divi\/placeholder \/-->","_et_gb_content_width":"","footnotes":""},"class_list":["post-1656","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/pages\/1656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/comments?post=1656"}],"version-history":[{"count":5,"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/pages\/1656\/revisions"}],"predecessor-version":[{"id":1838,"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/pages\/1656\/revisions\/1838"}],"up":[{"embeddable":true,"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/pages\/1607"}],"wp:attachment":[{"href":"https:\/\/lucylabs.gatech.edu\/ml4t\/wp-json\/wp\/v2\/media?parent=1656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}