{"action":"created","issue":{"url":"https://api.github.com/repos/lyst/lightfm/issues/292","repository_url":"https://api.github.com/repos/lyst/lightfm","labels_url":"https://api.github.com/repos/lyst/lightfm/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/lyst/lightfm/issues/292/comments","events_url":"https://api.github.com/repos/lyst/lightfm/issues/292/events","html_url":"https://github.com/lyst/lightfm/issues/292","id":320268221,"number":292,"title":"error in csv file opening ","user":{"login":"ravijoe","id":29393328,"avatar_url":"https://avatars2.githubusercontent.com/u/29393328?v=4","gravatar_id":"","url":"https://api.github.com/users/ravijoe","html_url":"https://github.com/ravijoe","followers_url":"https://api.github.com/users/ravijoe/followers","following_url":"https://api.github.com/users/ravijoe/following{/other_user}","gists_url":"https://api.github.com/users/ravijoe/gists{/gist_id}","starred_url":"https://api.github.com/users/ravijoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravijoe/subscriptions","organizations_url":"https://api.github.com/users/ravijoe/orgs","repos_url":"https://api.github.com/users/ravijoe/repos","events_url":"https://api.github.com/users/ravijoe/events{/privacy}","received_events_url":"https://api.github.com/users/ravijoe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-04T13:07:35Z","updated_at":"2018-05-07T06:33:26Z","closed_at":"2018-05-05T20:13:53Z","author_association":"NONE","body":"so this here is my code .\r\n\r\nimport csv\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.svm import SVR\r\ndates=[]\r\nprices=[]\r\ndef get_data(filename):\r\n    with open(filename,'r') as csvfile:\r\n        csvFileReader=csv.reader(csvfile)\r\n        next(csvFileReader)\r\n        for row in csvFileReader:\r\n            dates.append(int(row[0].split('-')[0]))\r\n            prices.append(float(row[1]))\r\n    return\r\n\r\ndef predict(dates,prices,x):\r\n    dates=np.reshape(dates,(len(dates),1))\r\n    svr_lin=SVR(kernel='linear',C=1e3)\r\n    svr_poly=SVR(kernel='poly',C=1e3,degree=2)\r\n    svr_rbf=SVR(kernel='rbf',C=1e3,gamma=0.1)\r\n    svr_lin.fit(dates,prices)\r\n    svr_poly.fit(dates, prices)\r\n    svr_rbf.fit(dates, prices)\r\n    \r\n    plt.scatter(dates,prices,color='black',label='Data')\r\n    plt.plot(dates,svr_rbf.predict(dates),color='red',label='RBF model')\r\n    plt.plot(dates, svr_lin.predict(dates), color='green', label='Linear model')\r\n    plt.plot(dates, svr_poly.predict(dates), color='blue', label='Polynomial model')\r\n    plt.xlabel('Date')\r\n    plt.ylabel('Price')\r\n    plt.title('Support Vector Regression')\r\n    plt.legend()\r\n    plt.show()\r\n    return svr_rbf.predict(x)[0],svr_lin.predict(x)[0],svr_poly.predict(x)[0]\r\n\r\nget_data('aapl.csv')\r\npredicted_price=predict(dates,prices,29)\r\nprint(predicted_price)\r\n\r\nand i am getting following errors\r\n\r\n\r\n\r\n\r\n\r\n![capture1](https://user-images.githubusercontent.com/29393328/39629462-ea5c8b48-4fc9-11e8-964b-10d55048b80e.JPG)\r\n\r\n\r\nand here is the 'aapl.csv ' file\r\n[aapl.zip](https://github.com/lyst/lightfm/files/1974498/aapl.zip)\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/lyst/lightfm/issues/comments/386970861","html_url":"https://github.com/lyst/lightfm/issues/292#issuecomment-386970861","issue_url":"https://api.github.com/repos/lyst/lightfm/issues/292","id":386970861,"user":{"login":"ravijoe","id":29393328,"avatar_url":"https://avatars2.githubusercontent.com/u/29393328?v=4","gravatar_id":"","url":"https://api.github.com/users/ravijoe","html_url":"https://github.com/ravijoe","followers_url":"https://api.github.com/users/ravijoe/followers","following_url":"https://api.github.com/users/ravijoe/following{/other_user}","gists_url":"https://api.github.com/users/ravijoe/gists{/gist_id}","starred_url":"https://api.github.com/users/ravijoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravijoe/subscriptions","organizations_url":"https://api.github.com/users/ravijoe/orgs","repos_url":"https://api.github.com/users/ravijoe/repos","events_url":"https://api.github.com/users/ravijoe/events{/privacy}","received_events_url":"https://api.github.com/users/ravijoe/received_events","type":"User","site_admin":false},"created_at":"2018-05-07T06:33:26Z","updated_at":"2018-05-07T06:33:26Z","author_association":"NONE","body":"i asked my question here because stackoverflow also couldn't answer the question . could you please run this code by yourself ?"}}
{"actor":{"display_login":"ravijoe"}}