Target definition by factorization_recommender

User 875 | 4/20/2015, 7:26:22 PM

I use factorization recommender, described here: http://graphlab.com/products/create/docs/generated/graphlab.recommender.factorization_recommender.create.html

I want to use it without to define target column. Anyway I got a ToolkitError:

<pre><code>In [52]: model = graphlab.factorizationrecommender.create(trainset, 'userId', 'trackCode') PROGRESS: Recsys training: model = factorizationrecommender [ERROR] Toolkit error: Method factorizationrecommender requires a numeric target column of scores or ratings; please specify this column using target_column = <name>.


ToolkitError Traceback (most recent call last) <ipython-input-52-6dbc5d5d84ac> in <module>() ----> 1 model3 = graphlab.factorizationrecommender.create(trainset, 'userId', 'trackCode')

/usr/local/lib/python2.7/dist-packages/graphlab/toolkits/recommender/factorizationrecommender.pyc in create(observationdata, userid, itemid, target, userdata, itemdata, numfactors, regularization, linearregularization, sidedatafactorization, nmf, binarytarget, maxiterations, sgdstepsize, randomseed, verbose, **kwargs) 199 opts.update(kwargs) 200 --> 201 response = graphlab.toolkits.main.run('recsystrain', opts, verbose) 202 203 return FactorizationRecommender(response['model'])

/usr/local/lib/python2.7/dist-packages/graphlab/toolkits/main.pyc in run(toolkitname, options, verbose, show_progress) 99 return params 100 else: --> 101 raise ToolkitError(str(message))

ToolkitError: Method factorizationrecommender requires a numeric target column of scores or ratings; please specify this column using targetcolumn = <name>. </code></pre> This is not correspond to the documentation (target=None by default)

Comments

User 4 | 4/21/2015, 8:09:02 AM

Sorry for the confusion. The documentation is not very clear on this, but for factorizationrecommender specifically, the <code>target</code> parameter is actually required. You can see that described <a href="https://dato.com/products/create/docs/generated/graphlab.recommender.factorizationrecommender.create.html#graphlab.recommender.factorization_recommender.create">here</a> in the documentation:

<blockquote>The observation_data must contain a column of scores representing ratings given by the users. If not present, consider using the ranking version of the factorization model, RankingFactorizationRecommender,</blockquote>