{"action":"created","issue":{"url":"https://api.github.com/repos/lyst/lightfm/issues/369","repository_url":"https://api.github.com/repos/lyst/lightfm","labels_url":"https://api.github.com/repos/lyst/lightfm/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/lyst/lightfm/issues/369/comments","events_url":"https://api.github.com/repos/lyst/lightfm/issues/369/events","html_url":"https://github.com/lyst/lightfm/issues/369","id":357150863,"node_id":"MDU6SXNzdWUzNTcxNTA4NjM=","number":369,"title":"Finding the precision and auc scores. ","user":{"login":"nishal999","id":42346467,"node_id":"MDQ6VXNlcjQyMzQ2NDY3","avatar_url":"https://avatars0.githubusercontent.com/u/42346467?v=4","gravatar_id":"","url":"https://api.github.com/users/nishal999","html_url":"https://github.com/nishal999","followers_url":"https://api.github.com/users/nishal999/followers","following_url":"https://api.github.com/users/nishal999/following{/other_user}","gists_url":"https://api.github.com/users/nishal999/gists{/gist_id}","starred_url":"https://api.github.com/users/nishal999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nishal999/subscriptions","organizations_url":"https://api.github.com/users/nishal999/orgs","repos_url":"https://api.github.com/users/nishal999/repos","events_url":"https://api.github.com/users/nishal999/events{/privacy}","received_events_url":"https://api.github.com/users/nishal999/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-05T09:49:53Z","updated_at":"2018-09-06T12:16:13Z","closed_at":null,"author_association":"NONE","body":"I am building a recommendation model for user-article dataset where each interaction is represented by 1.\r\n\r\n`model = LightFM(loss='warp',\r\n                item_alpha=ITEM_ALPHA,\r\n                user_alpha=USER_ALPHA,\r\n                no_components=NUM_COMPONENTS,\r\n                learning_rate=LEARNING_RATE,\r\n                learning_schedule=LEARNING_SCHEDULE)`\r\n\r\n`model = model.fit(train,\r\n                item_features=itemf,\r\n                user_features=uf,\r\n                epochs=NUM_EPOCHS,\r\n                num_threads=NUM_THREADS)`\r\n\r\n`print(\"train shape: \",train.shape)\r\nprint(\"test shape: \",test.shape)`\r\n\r\ntrain shape:  (25900, 790)\r\ntest shape:  (25900, 790)\r\n\r\nMy predict model looks like this:\r\n\r\n`predictions = model.predict(\r\n        user_id,\r\n        pid_array,\r\n        user_features=uf,\r\n        item_features=itemf,\r\n        num_threads=4)`\r\n\r\nwhere pid_array are indexes of number of items\r\n\r\n`train_precision = precision_at_k(model, train, k=10).mean()`\r\n\r\n**I am trying to predict the precision and subsequently want auc score also. But I get this error.**\r\n\r\nTraceback (most recent call last):\r\n  File \"new_light_fm.py\", line 366, in <module>\r\n    train_precision = precision_at_k(model, train, k=10).mean()\r\n  File \"/home/nt/anaconda3/lib/python3.6/site-packages/lightfm/evaluation.py\", line 69, in precision_at_k\r\n    check_intersections=check_intersections,\r\n  File \"/home/nt/anaconda3/lib/python3.6/site-packages/lightfm/lightfm.py\", line 807, in predict_rank\r\n    raise ValueError('Incorrect number of features in item_features')\r\nValueError: Incorrect number of features in item_features\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/lyst/lightfm/issues/comments/419071955","html_url":"https://github.com/lyst/lightfm/issues/369#issuecomment-419071955","issue_url":"https://api.github.com/repos/lyst/lightfm/issues/369","id":419071955,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTA3MTk1NQ==","user":{"login":"DoronGi","id":41697953,"node_id":"MDQ6VXNlcjQxNjk3OTUz","avatar_url":"https://avatars2.githubusercontent.com/u/41697953?v=4","gravatar_id":"","url":"https://api.github.com/users/DoronGi","html_url":"https://github.com/DoronGi","followers_url":"https://api.github.com/users/DoronGi/followers","following_url":"https://api.github.com/users/DoronGi/following{/other_user}","gists_url":"https://api.github.com/users/DoronGi/gists{/gist_id}","starred_url":"https://api.github.com/users/DoronGi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoronGi/subscriptions","organizations_url":"https://api.github.com/users/DoronGi/orgs","repos_url":"https://api.github.com/users/DoronGi/repos","events_url":"https://api.github.com/users/DoronGi/events{/privacy}","received_events_url":"https://api.github.com/users/DoronGi/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T12:16:13Z","updated_at":"2018-09-06T12:16:13Z","author_association":"NONE","body":"There is no problem to do so. You build one dataset to which you fit **all** your users, user-features, items and item-features by calling ```fit``` and ```fit_partial```. Similarly you call ```build_user_features``` and ```build_item_features``` to build the feature matrices for **all** users and items.  Next you call ```build_interactions``` twice, once with the interactions of the first user group (1-11 months) to get the test interaction matrix, and the second time with the interactions of the second user group (12th month) to get the test matrix."}}
{"actor":{"display_login":"DoronGi"}}