{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":48980,"title":"F-score","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the F-score given TP, FP and FN. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = F_score(tp,fp,fn)\r\n  y = x;\r\nend","test_suite":"%%\r\ntp=4;\r\nfp=5;\r\nfn=3;\r\nassert(isequal(F_score(tp,fp,fn),0.5))\r\n%%\r\ntp=30;\r\nfp=40;\r\nfn=52;\r\nassert(isequal(F_score(tp,fp,fn),0.3947))\r\n%%\r\ntp=70;\r\nfp=50;\r\nfn=0;\r\nassert(isequal(F_score(tp,fp,fn),0.7368))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T16:02:28.000Z","updated_at":"2026-02-11T18:18:26.000Z","published_at":"2020-12-31T01:19:51.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the F-score given TP, FP and FN. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":48975,"title":"Mean Square Error","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 21px; transform-origin: 343px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 21px; text-align: left; transform-origin: 320px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the Mean Square Error given real and estimated values. Round the result to the second decimal.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function e = mse(y0,y)\r\n    e = y0;\r\nend","test_suite":"%%\r\ny0=[1:10];\r\ny=y0+0.3;\r\nassert(isequal(mse(y0,y),0.0900))\r\n%%\r\ny0=[1:45];\r\ny=y0+0.5;\r\nassert(isequal(mse(y0,y),0.2500))\r\n%%\r\ny0=[1000:2000];\r\ny=y0+0.1;\r\nassert(isequal(mse(y0,y),0.0100))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T15:52:11.000Z","updated_at":"2026-02-16T12:31:02.000Z","published_at":"2020-12-31T01:19:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the Mean Square Error given real and estimated values. Round the result to the second decimal.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":55185,"title":"Ridge regularized linear regression","description":"Given a predictor data matrix  of size , target variable vector  of size  and a shrinkage factor  (scalar) (ridge regularization), write the function to compute linear regression model coefficients   to model the data. The data has  observations,  predictor variables in the  matrix \r\nThe model is defines as:  where sigma is gaussian noise.\r\n(Hint: search on google for closed form solution of a linear regression problem)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 61.5px; transform-origin: 407px 61.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 93px 8px; transform-origin: 93px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a predictor data matrix \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eX\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 24px 8px; transform-origin: 24px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of size \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAlCAYAAAAk9TVSAAAErElEQVRoQ+1aTahNURS+b66IEQOEASUGfksUA0oZKQykN/IzkAwIIyOEOU8GMhBKklIMKCJ/A4oYUBgw8lPM+T7t9VpOe++1zrnbO5d3dn29e+85Z++1v/Xttdbe5w31utYaA0OtjdwN3OvIb1EEHfn/EPmTYesO4GiLNg/q0Afr8lJH+ST+BrAbeDKoDLRo12aMvRdYD3zx2OEln8TfB7Z1xGdp3Ymre4AVHgd4yX+Izu4C+z0eHef3HMf8ZwBcCdnmIZ+dbQWmWZ11138zwCjxIoSgSzlOLPLZ0XtgH3C6I9fNAMPPibACkvHfIr9TvZvvP24U0R7Br8nK0CL/Ox6+ALC8HOtG9cwC6uaZETxzG8gu+TGYDMdfmQvXOfKZMC4CW1qYyBKM+TgQdKaG8znhTcAPYA3QZklM8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XfHbK0OPJ+C4DBuAmXWL2c/BXm5cm5A8AX8VMYJjg2zfdnuPLFaBOpdTIoPFOfiPSSj3UkV+KyQb9dOQ3IK3UIx35pZhs0M8vdQg0NQzSmyAAAAAASUVORK5CYII=\" style=\"width: 47.5px; height: 18.5px;\" width=\"47.5\" height=\"18.5\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 73px 8px; transform-origin: 73px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, target variable vector \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ey\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 24px 8px; transform-origin: 24px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of size \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAAAlCAYAAADPwo5RAAAEA0lEQVRoQ+2ZS6hOURTH750biJkBwoCSiTxKFANKGSkMpDvyGEgGhJEMEOYeGRgJMxPFgCLymBgQAwoDRqSY8//VWbfd5+zX2bvTd6+z69/tfmc/f3udtdbeZ3JiKL0SmOx1tGGwiQF4z0YwAB9z4PM0vwPSuZ7nOa7DncxlkWPhwL4nHZZejSuBnue1W+MdlbZLP1LGTgUO7KfSvgH2P1gP6pcj0oYU6KnAn6uzx9LxlF2cBXW2ag1npLuJLuOC6i2SsPhgSQFOZ3ulB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0D/wvF0hU1jEhjpgAAAABJRU5ErkJggg==\" style=\"width: 46px; height: 18.5px;\" width=\"46\" height=\"18.5\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 75px 8px; transform-origin: 75px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and a shrinkage factor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eλ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28px 8px; transform-origin: 28px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (scalar) (ridge regularization), write the function to compute linear regression model coefficients \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eβ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAlCAYAAAAk9TVSAAAEY0lEQVRoQ+2aS8hNURTHv2/OhBEDhIGv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Zg4+LZnLRpOR0KV8cg1W4cuKoP/jd60bE6Ba8KUnwF/JljSW51evHLvogV4OvuVlin9sQPhPoa/QDOgNxKBY58W7HycsAPwVoH0LJZNH6Dyfkl243OeOn69Tj0Op9FieT57A5uCzUUIluJz1+1lMk5NQGaj/SZBbIevpZN3nQn3Q3qPVP4Z4wBja4/yuRwOfheVdZMr3y5FC6VxbO+iulFP/2UALnwNjpRegkA8TH8dyFtfQFWCl+qH+5wIbtMCXFXA7MAH+kYIlNS016C7Uw6RgOaTNDM3wOUhWXv1LhH9EbNmUdQFaqT6EuCTrtlp+tTLmwVsgBmO5vuHLE6juS+tSMDpfT1P4nR9glzvYw29xdnr4PfwWCbTY9C8lohM1eTI+TwAAAABJRU5ErkJggg==\" style=\"width: 47.5px; height: 18.5px;\" width=\"47.5\" height=\"18.5\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 75.5px 8px; transform-origin: 75.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e to model the data. The data has \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 46.5px 8px; transform-origin: 46.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e observations, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 82px 8px; transform-origin: 82px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e predictor variables in the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eX\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 22.5px 8px; transform-origin: 22.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 79px 8px; transform-origin: 79px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe model is defines as: \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAA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JuLdlnKYG8G/MFNxZ9TNgrLFvfWFZQNd7zWRJW1GKzvqMNG9d2L2afd8P1++MSdnfOxW80gYwcrCdVKDXLnIw5SwmUKsczwFtC6nyohpLH6sPOrsi4UO4uwQfTOdlY3JQq7PkdXkLI3DprujBvdfEqKQPgXXvUguaE5BcV+vtlrc8csjA7u2J9PkvywXRf4c9bl5R5932VuMSNJJBV2Rmzz+WZlUpa0EUIZIq3jAMBvbaE9ZkDgZgDtY7wgNS76tQBK0L31iVGDr/Da1gfxqxpgbwOUjcEfIw3OAbyC8AfkvpRZJzNmUxu+7q/W+wSC3x9xskrKcvhN1MY29gJPmdsJbFP6dTHIlAquLc19rm4hf5Xho+DIFEsai8VxlTtjDx9lXNfHI2188cfMeviyVWriFjbAoUF0LDibmTNFkIXcWFecKWp4lREiY3r/X7fxS7fjn7CHerdk5cD1uuSYLcPUULuKGQR+dS0QBYDhjcl+Z2bB9xCYPNk17AIgVgsgXSvSVtEIhvUFsv5rmDXNhiWncW1U3+vBmI8LMSuuyJMjnTIuHz6/qO+cz8Hd36P8L1wsWtTe3k1CcTcrApNBkaw/KvAiQLroQpdcpSzkAtjh3FneBVdV01lWmbSF2TXHM/6sgtl3+mH2dytLrVAZvKOjrS7xhD4GH2WpO9jjDvbPksJhNnm1t1srlJOJNFURX6i6Uw/bIxA7LIDwhXBfD4zrXGnZfoVD5uBZWg10/NhM5r47RiBwpPpWheiJl7q4OFztxIGD7CKHcQIRLDGtQ2CRQ5Kh9zjXUWZpOZM7YTbejzPCjVT9JWVU2kMtLILbBMfVwKNQOPK95bvvRHollfxuAv8H/xaYjSm2MJCAAAAAElFTkSuQmCC\" style=\"width: 72px; height: 18px;\" width=\"72\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 100px 8px; transform-origin: 100px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e where sigma is gaussian noise.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 248px 8px; transform-origin: 248px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(Hint: search on google for closed form solution of a linear regression problem)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function beta = your_fcn_name(X,y,lambda)\r\n\r\nend","test_suite":"%%\r\nX = [1,2,3;\r\n     1,4,2;\r\n     1,5,1;\r\n     1,6,2;\r\n     1,2,4;\r\n     1,3,2];\r\ny = [1;3;2;4;3;4];\r\nlambda = 1;\r\nbeta_correct = [2117;8399;4729];\r\nassert(isequal(your_fcn_name(X,y,lambda),beta_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":2450735,"edited_by":223089,"edited_at":"2022-07-14T06:37:54.000Z","deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2022-07-13T20:32:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-13T20:27:08.000Z","updated_at":"2026-03-17T07:20:23.000Z","published_at":"2022-07-13T20:32:30.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a predictor data matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eX\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e of size \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(n \\\\times p)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, target variable vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e of size \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(n \\\\times 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and a shrinkage factor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\lambda\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e (scalar) (ridge regularization), write the function to compute linear regression model coefficients \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\beta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(p \\\\times 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e to model the data. The data has \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e observations, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e predictor variables in the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eX\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe model is defines as: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = X\\\\beta + \\\\sigma\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e where sigma is gaussian noise.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(Hint: search on google for closed form solution of a linear regression problem)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1,"title":"Times 2 - START HERE","description":"Try out this test problem first.\r\n\r\nGiven the variable x as your input, multiply it by two and put the result in y.\r\n\r\nExamples:\r\n\r\n Input  x = 2\r\n Output y is 4\r\n\r\n Input  x = 17\r\n Output y is 34\r\n","description_html":"\u003cp\u003eTry out this test problem first.\u003c/p\u003e\u003cp\u003eGiven the variable x as your input, multiply it by two and put the result in y.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre\u003e Input  x = 2\r\n Output y is 4\u003c/pre\u003e\u003cpre\u003e Input  x = 17\r\n Output y is 34\u003c/pre\u003e","function_template":"function y = times2(x) % Do not edit this line.\r\n\r\n  % Modify the line below so that the output y is twice the incoming value x\r\n\r\n  y = x;\r\n\r\n  % After you modify the code, press the \"Submit\" button, and you're on your way.\r\n\r\nend % Do not edit this line.","test_suite":"%%\r\nassert(isequal(times2(1),2));\r\n\r\n%%\r\nassert(isequal(times2(11),22));\r\n\r\n%%\r\nassert(isequal(times2(-3),-6));\r\n\r\n%%\r\nassert(isequal(times2(29),58));","published":true,"deleted":false,"likes_count":2290,"comments_count":147,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":114387,"test_suite_updated_at":"2012-01-25T22:41:49.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:16.000Z","updated_at":"2026-04-04T21:54:13.000Z","published_at":"2012-01-18T01:00:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTry out this test problem first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the variable x as your input, multiply it by two and put the result in y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Input  x = 2\\n Output y is 4\\n\\n Input  x = 17\\n Output y is 34]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":48980,"title":"F-score","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 10.5px; transform-origin: 343px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the F-score given TP, FP and FN. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = F_score(tp,fp,fn)\r\n  y = x;\r\nend","test_suite":"%%\r\ntp=4;\r\nfp=5;\r\nfn=3;\r\nassert(isequal(F_score(tp,fp,fn),0.5))\r\n%%\r\ntp=30;\r\nfp=40;\r\nfn=52;\r\nassert(isequal(F_score(tp,fp,fn),0.3947))\r\n%%\r\ntp=70;\r\nfp=50;\r\nfn=0;\r\nassert(isequal(F_score(tp,fp,fn),0.7368))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":29,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T16:02:28.000Z","updated_at":"2026-02-11T18:18:26.000Z","published_at":"2020-12-31T01:19:51.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the F-score given TP, FP and FN. \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":48975,"title":"Mean Square Error","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 21px; transform-origin: 343px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 21px; text-align: left; transform-origin: 320px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the Mean Square Error given real and estimated values. Round the result to the second decimal.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function e = mse(y0,y)\r\n    e = y0;\r\nend","test_suite":"%%\r\ny0=[1:10];\r\ny=y0+0.3;\r\nassert(isequal(mse(y0,y),0.0900))\r\n%%\r\ny0=[1:45];\r\ny=y0+0.5;\r\nassert(isequal(mse(y0,y),0.2500))\r\n%%\r\ny0=[1000:2000];\r\ny=y0+0.1;\r\nassert(isequal(mse(y0,y),0.0100))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":698530,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T15:52:11.000Z","updated_at":"2026-02-16T12:31:02.000Z","published_at":"2020-12-31T01:19:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the Mean Square Error given real and estimated values. Round the result to the second decimal.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":55185,"title":"Ridge regularized linear regression","description":"Given a predictor data matrix  of size , target variable vector  of size  and a shrinkage factor  (scalar) (ridge regularization), write the function to compute linear regression model coefficients   to model the data. The data has  observations,  predictor variables in the  matrix \r\nThe model is defines as:  where sigma is gaussian noise.\r\n(Hint: search on google for closed form solution of a linear regression problem)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 61.5px; transform-origin: 407px 61.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 93px 8px; transform-origin: 93px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a predictor data matrix \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eX\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 24px 8px; transform-origin: 24px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of size \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAlCAYAAAAk9TVSAAAErElEQVRoQ+1aTahNURS+b66IEQOEASUGfksUA0oZKQykN/IzkAwIIyOEOU8GMhBKklIMKCJ/A4oYUBgw8lPM+T7t9VpOe++1zrnbO5d3dn29e+85Z++1v/Xttdbe5w31utYaA0OtjdwN3OvIb1EEHfn/EPmTYesO4GiLNg/q0Afr8lJH+ST+BrAbeDKoDLRo12aMvRdYD3zx2OEln8TfB7Z1xGdp3Ymre4AVHgd4yX+Izu4C+z0eHef3HMf8ZwBcCdnmIZ+dbQWmWZ11138zwCjxIoSgSzlOLPLZ0XtgH3C6I9fNAMPPibACkvHfIr9TvZvvP24U0R7Br8nK0CL/Ox6+ALC8HOtG9cwC6uaZETxzG8gu+TGYDMdfmQvXOfKZMC4CW1qYyBKM+TgQdKaG8znhTcAPYA3QZklM8ZwClqbsyJFPBW0HpgCuurWwmsR4dutxgCa+RI5i6FgM3FLzWhs+P3VwIgI6hHujoSdHPsvLZYAVmjgIw8MiYBUwHRgORnMC9D43HhOAy4BZ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0NQzSmyAAAAAASUVORK5CYII=\" style=\"width: 47.5px; height: 18.5px;\" width=\"47.5\" height=\"18.5\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 73px 8px; transform-origin: 73px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, target variable vector \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ey\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 24px 8px; transform-origin: 24px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of size \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAAAlCAYAAADPwo5RAAAEA0lEQVRoQ+2ZS6hOURTH750biJkBwoCSiTxKFANKGSkMpDvyGEgGhJEMEOYeGRgJMxPFgCLymBgQAwoDRqSY8//VWbfd5+zX2bvTd6+z69/tfmc/f3udtdbeZ3JiKL0SmOx1tGGwiQF4z0YwAB9z4PM0vwPSuZ7nOa7DncxlkWPhwL4nHZZejSuBnue1W+MdlbZLP1LGTgUO7KfSvgH2P1gP6pcj0oYU6KnAn6uzx9LxlF2cBXW2ag1npLuJLuOC6i2SsPhgSQFOZ3ulBbHOZsFzA72uWcupROB4gDeNe7kd4hADTkefpWPSlVkA1LcE1nmisdJV+rs8EzjVcS0Xmz68/jwG/H+xboBTAIWV3+8A3IzzbOitiAH/pcY3JVLBvgsWs0TKjRtX1eahFHy1A4vpCpwuGXOj5HW/IeAEgFvSnoLJd92kNWr4sml8LWPDWfAu6be0ReqSvpYAx0guS2t9Y4eAYyn7pflSUo7Zla6nnU2exynQXdglMacEuBmKN9iGgJMKEq1jbodBePVXS5ukhdKU9EDCr7HjHAzmSHekaOrkbEAq9FqwGboEOO3/hNYZgon/fiutj1gux9vFEm8D5Zu0Uloq4Us5nbqRf1uzGZFupx/HoNeEXQv4Cx+3EHB2ytuwhRb1KVjxJYlDw1QDl2yH15zi9W+BHfBBrw27BnA8A295a+CsBdx9DQmypxtZpmBg3uv3pCNwC/xR6HNVxwJkic8eHarUpQRdcS3gZsFkB8+kT5KbSr7T/xwmcn34KAwXOs8YrybsWhbujX21gBtQJowbcm/P8OUfGnI1Ukx3LAIzMaFmKbVw5kdZ0TapEPCvavBFigVNMpHvTuejPtqsEmvkgqckxTTX5K4lJWXM2ZBS4MHYVyMtTM0icgJwG6DRAEkdUk5KTeg1gHvnEwJufnmZFvQxYCKu1bVlIKSX5OCpN28psO0iLbbZOZZtdUuAW9tD6qz1si8E3E5NMb9rQNss2D2i22Zwgs25m4mlfrWhlwDnTMLllddIY6dI/PgTyXc6dIG2WbBdD1g6iAvgujf1QioG26yyJvQS4KSEFG/ciwHHrfB6+IKd7SiDtO2q5aSWLv5s+ksJnKmwa0N3D2k5scGyMa87YaIx4LEPEAbUd6CxG0eAY93npRTYZmW5ebabEe3UWKSNqQXQOyT7+GDtcJV8XozN3dq3poPWWQw49YB2PWDlqQvKrQc8Su6Xpq7tcufn1se6X0vRTU4BTsd2RM+56StZwExrm/yRPRU4AOj0RgeLm2nwcueb/MWejnOAm6U/GqBP7wnua3PjdpM2Khc4neJWun4vTJrUDKqUzaIL8BnEY/ymOgDveU8G4APwngn0PNxg4T0D/wvF0hU1jEhjpgAAAABJRU5ErkJggg==\" style=\"width: 46px; height: 18.5px;\" width=\"46\" height=\"18.5\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 75px 8px; transform-origin: 75px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and a shrinkage factor \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eλ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 28px 8px; transform-origin: 28px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (scalar) (ridge regularization), write the function to compute linear regression model coefficients \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eβ\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAlCAYAAAAk9TVSAAAEY0lEQVRoQ+2aS8hNURTHv2/OhBEDhIGvJBOPEsWAEiOFgUzIYyAZEEaSECMZePQNjISZiSJRpDwmiBhQSIy8Ys7/X3tpO+3HWufs6xzXOfXv3s7dZz9+e+211t7njo70V2sERltruW94pIffoh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fkl243OeOn69Tj0Op9FieT57A5uCzUUIluJz1+1lMk5NQGaj/SZBbIevpZN3nQn3Q3qPVP4Z4wBja4/yuRwOfheVdZMr3y5FC6VxbO+iulFP/2UALnwNjpRegkA8TH8dyFtfQFWCl+qH+5wIbtMCXFXA7MAH+kYIlNS016C7Uw6RgOaTNDM3wOUhWXv1LhH9EbNmUdQFaqT6EuCTrtlp+tTLmwVsgBmO5vuHLE6juS+tSMDpfT1P4nR9glzvYw29xdnr4PfwWCbTY9C8lohM1eTI+TwAAAABJRU5ErkJggg==\" style=\"width: 47.5px; height: 18.5px;\" width=\"47.5\" height=\"18.5\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 75.5px 8px; transform-origin: 75.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e to model the data. The data has \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 46.5px 8px; transform-origin: 46.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e observations, \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 82px 8px; transform-origin: 82px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e predictor variables in the \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003eX\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 22.5px 8px; transform-origin: 22.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e matrix \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 79px 8px; transform-origin: 79px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe model is defines as: \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAAAkCAYAAABmHbPbAAAFpklEQVR4Xu2bTehVRRjGdZ8EtUqiFrkwCqxFH9BOUEGECNG0Ni2ij0VEi4JciQsFXbRMxaBVWKAQiVBIiyLo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H6sPOrsi4UO4uwQfTOdlY3JQq7PkdXkLI3DprujBvdfEqKQPgXXvUguaE5BcV+vtlrc8csjA7u2J9PkvywXRf4c9bl5R5932VuMSNJJBV2Rmzz+WZlUpa0EUIZIq3jAMBvbaE9ZkDgZgDtY7wgNS76tQBK0L31iVGDr/Da1gfxqxpgbwOUjcEfIw3OAbyC8AfkvpRZJzNmUxu+7q/W+wSC3x9xskrKcvhN1MY29gJPmdsJbFP6dTHIlAquLc19rm4hf5Xho+DIFEsai8VxlTtjDx9lXNfHI2188cfMeviyVWriFjbAoUF0LDibmTNFkIXcWFecKWp4lREiY3r/X7fxS7fjn7CHerdk5cD1uuSYLcPUULuKGQR+dS0QBYDhjcl+Z2bB9xCYPNk17AIgVgsgXSvSVtEIhvUFsv5rmDXNhiWncW1U3+vBmI8LMSuuyJMjnTIuHz6/qO+cz8Hd36P8L1wsWtTe3k1CcTcrApNBkaw/KvAiQLroQpdcpSzkAtjh3FneBVdV01lWmbSF2TXHM/6sgtl3+mH2dytLrVAZvKOjrS7xhD4GH2WpO9jjDvbPksJhNnm1t1srlJOJNFURX6i6Uw/bIxA7LIDwhXBfD4zrXGnZfoVD5uBZWg10/NhM5r47RiBwpPpWheiJl7q4OFztxIGD7CKHcQIRLDGtQ2CRQ5Kh9zjXUWZpOZM7YTbejzPCjVT9JWVU2kMtLILbBMfVwKNQOPK95bvvRHollfxuAv8H/xaYjSm2MJCAAAAAElFTkSuQmCC\" style=\"width: 72px; height: 18px;\" width=\"72\" height=\"18\"\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 100px 8px; transform-origin: 100px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e where sigma is gaussian noise.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 248px 8px; transform-origin: 248px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(Hint: search on google for closed form solution of a linear regression problem)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function beta = your_fcn_name(X,y,lambda)\r\n\r\nend","test_suite":"%%\r\nX = [1,2,3;\r\n     1,4,2;\r\n     1,5,1;\r\n     1,6,2;\r\n     1,2,4;\r\n     1,3,2];\r\ny = [1;3;2;4;3;4];\r\nlambda = 1;\r\nbeta_correct = [2117;8399;4729];\r\nassert(isequal(your_fcn_name(X,y,lambda),beta_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":2450735,"edited_by":223089,"edited_at":"2022-07-14T06:37:54.000Z","deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":"2022-07-13T20:32:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-13T20:27:08.000Z","updated_at":"2026-03-17T07:20:23.000Z","published_at":"2022-07-13T20:32:30.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a predictor data matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eX\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e of size \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(n \\\\times p)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, target variable vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e of size \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(n \\\\times 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and a shrinkage factor \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\lambda\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e (scalar) (ridge regularization), write the function to compute linear regression model coefficients \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e\\\\beta\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(p \\\\times 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e to model the data. The data has \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e observations, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e predictor variables in the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003eX\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e matrix \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe model is defines as: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = X\\\\beta + \\\\sigma\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e where sigma is gaussian noise.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(Hint: search on google for closed form solution of a linear regression problem)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":1,"title":"Times 2 - START HERE","description":"Try out this test problem first.\r\n\r\nGiven the variable x as your input, multiply it by two and put the result in y.\r\n\r\nExamples:\r\n\r\n Input  x = 2\r\n Output y is 4\r\n\r\n Input  x = 17\r\n Output y is 34\r\n","description_html":"\u003cp\u003eTry out this test problem first.\u003c/p\u003e\u003cp\u003eGiven the variable x as your input, multiply it by two and put the result in y.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre\u003e Input  x = 2\r\n Output y is 4\u003c/pre\u003e\u003cpre\u003e Input  x = 17\r\n Output y is 34\u003c/pre\u003e","function_template":"function y = times2(x) % Do not edit this line.\r\n\r\n  % Modify the line below so that the output y is twice the incoming value x\r\n\r\n  y = x;\r\n\r\n  % After you modify the code, press the \"Submit\" button, and you're on your way.\r\n\r\nend % Do not edit this line.","test_suite":"%%\r\nassert(isequal(times2(1),2));\r\n\r\n%%\r\nassert(isequal(times2(11),22));\r\n\r\n%%\r\nassert(isequal(times2(-3),-6));\r\n\r\n%%\r\nassert(isequal(times2(29),58));","published":true,"deleted":false,"likes_count":2290,"comments_count":147,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":114387,"test_suite_updated_at":"2012-01-25T22:41:49.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:16.000Z","updated_at":"2026-04-04T21:54:13.000Z","published_at":"2012-01-18T01:00:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTry out this test problem first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the variable x as your input, multiply it by two and put the result in y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Input  x = 2\\n Output y is 4\\n\\n Input  x = 17\\n Output y is 34]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"machine learning\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"machine learning\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"machine learning\"","","\"","machine learning","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fac45df1ff8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fac45df1f58\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fac45df14b8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fac45df2278\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fac45df21d8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fac45df2138\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fac45df2098\u003e":"tag:\"machine learning\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fac45df2098\u003e":"tag:\"machine learning\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"machine learning\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"machine learning\"","","\"","machine learning","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fac45df1ff8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fac45df1f58\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fac45df14b8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fac45df2278\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fac45df21d8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fac45df2138\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fac45df2098\u003e":"tag:\"machine learning\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fac45df2098\u003e":"tag:\"machine learning\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":48980,"difficulty_rating":"easy"},{"id":48975,"difficulty_rating":"easy"},{"id":55185,"difficulty_rating":"easy"},{"id":1,"difficulty_rating":"easy"}]}}