Comments (8)
I'd need a more detailed piece of code to check what's wrong, including what kind of objects are _testNegatives
, _testRatings
, and how you generated them from triplets (user, item, rating)
, but for now:
- Why are you appending
gtItems
? If these are lists of lists, wouldn't that leave you with a list having another list as last element? - Shouldn't the NDCG be evaluated only with the ratings of a user in a hold-out sample? Are you trying to use this for implicit-feedback data?
- I assume HR is hit ratio - shouldn't this take a topN ranking among the non-training items?
- Are you using some existing package for calculating these metrics?
lstA = [[1, 2, 3], [4, 5], [6]]
lstB = [[7, 8], [9, 10, 11], [12]]
def modify_list_el(ix):
entryA = lstA[ix]
entryB = lstB[ix]
entryB.append(entryA)
return entryB
modify_list_el(0)
>>> [7, 8, [1, 2, 3]] ## Last el. is a list
np.array(modify_list_el(0))
>>> array([7, 8, list([1, 2, 3])], dtype=object)
### This is not the expected input for _model.predict
from cmfrec.
The model object will actually accept both numpy arrays and lists - e.g.
CMF_obj.predict([0, 0, 0], [1, 2, 3])
CMF_obj.predict(np.array([0, 0, 0]), np.array([1, 2, 3]))
But would not work correctly with this:
CMF_obj.predict([0, 0, 0], [1, 2, [3, 4, 5]])
Although if you are not getting any error, I guess you're passing flat arrays already. Still, NDCG for explicit-feedback data (e.g. ratings) I think should be computed only with the test items, not the negative sample, unless you are trying to evaluate implicit-feedback metrics. If you are trying to fit a model to implicit-feedback data (e.g. clicks) and want to evaluate on the negative entries, you might want to try methods meant for that kind of data instead (e.g. https://www.github.com/david-cortes/ctpfrec).
from cmfrec.
the predict be used to rank, then eval model by hr,ngcf
from cmfrec.
thanks for your reply. the item is negative sample of the user. acturely, the input of cmf.predict is the form of [array[0,0,0], array[1,2,3]] . so it should be input as list not array ?i will try to change to list . i am so sorry for disturbe. and thanks for your time
from cmfrec.
thanks for your reply. acturely. I recommend for implicit ratings. Each user is sorted from 100 samples by the leave-one-out evalution , among which 99 negative samples ,denoted by item in code , dtype:list, and 1 positive sample ,denoted by gtItem in code, dtype:int. Therefore, the input is[ user(dtype: array), item(dtype:array)]. There were no errors during the run, but the results were much worse than the BPRMF. So this model is not suitable for implicit rating recommendations? thanks for your time and your resources. I will study it carefully
from cmfrec.
That's right, this model is not suitable for implicit-feedback data. Unlike BPR or implicit-ALS, it will not fit the model to the negative entries in the training data, so if you're looking to optimize those kinds of metrics, this is not the right choice.
from cmfrec.
thanks for your help. ^_^ I will try another method. I have been studying cross-domain recommendation recently and hope to have more opportunities to communicate later
from cmfrec.
Closing as the latest version includes an implicit-feedback version.
from cmfrec.
Related Issues (20)
- R API HOT 1
- Ruby Library HOT 12
- Mac installation w/ Homebrew Python HOT 4
- nan predictions for unseen users and items HOT 7
- IndexError: Out of bounds on buffer access (axis 0) HOT 1
- Install error on Windows HOT 2
- swap_users_and_items - unexpected keyword argument 'scale_lam' HOT 1
- I tried pip install cmfrec but get this error: Command errored out with exit status 1, and ERROR: Could not build wheels for cmfrec which use PEP 517 and cannot be installed directly
- something error when install cmfrec on Linux HOT 3
- name 'n' is not defined when using CMF_implicit() HOT 1
- predict_new() for OMF: name 'glob_mean' is not defined HOT 1
- ERROR: Invalid parameter combination, for fitting OMF HOT 1
- topN function for C API HOT 2
- Fetching entire predicted dataset HOT 1
- fit() got an unexpected keyword argument 'X' HOT 4
- Implicit feedback or explicit feedback HOT 1
- Getting different scores with using predict_new and predict methods HOT 1
- Upstream prematurely closing connection on nginx when using topN method HOT 2
- Different topN results using Dataframe vs COO HOT 6
- How to predict items for new users based on a implicit CMFREC Model? (R) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmfrec.