Code Monkey home page Code Monkey logo

racf's People

Contributors

miferroudjene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

racf's Issues

Help with the RACF again

Hi,

It is me again. Very appreciate the codes, it helps me a lot in understanding the paper. However, one minor thing, with the Gpop as the baseline model of the paper, I have managed to calculate the global similarity with (sumBui over users)/(sumBu over users). However, for the prediction and evaluation of the method, I got it all wrong. Could you have a look at those code and please give me some advice, suggestions?

def GPopMat(df_train, n_items):
'''
Calculate the user popularity matrix with the given recency window
'''
BUCount = df_train.groupby(['UID'])['order'].max().reset_index(name='Bu')
BUICount = df_train.groupby(['UID','PID'])['BID'].count().reset_index(name='Bui')
n_users = df_train.UID.unique().shape[0]
tmp = pd.merge(BUICount, BUCount, on='UID')
tmp['piUI'] = tmp['Bui']/tmp['Bu']

table = pd.pivot_table(tmp, values=['Bui','Bu'], index=['PID'], aggfunc=np.sum)
tmp2 = table.reset_index()
tmp2.columns = ['item', 'sumBUi', 'sumBU']
tmp2['globalPopularity'] = tmp2['sumBUi'] / tmp2['sumBU']
tmp2['UID'] = tmp['UID']
tmp2['PID'] = tmp['PID']

df_Gpop = tmp2[['PID','globalPopularity']]
del tmp2
del tmp
GPop_mat = sparse.coo_matrix((df_Gpop.globalPopularity.values, (df_Gpop.PID.values)), shape=(n_items))
#del df_Gpop
return sparse.csr_matrix(GPop_mat)


Gpop_mat.shape


prediction

score, pred = prediction(Gpop_mat.toarray(), k=5)
test_ndcg, dev_ndcg = evaluation(score, pred, test_set, dev_set, k=5)
print("test score:",test_ndcg,"\n dev score:",dev_ndcg)
del score,pred

Thanks so much again and have a very nice day!

Best,
Diep

Similaripy package error

Hi,

My name is Diep from Erasmus Uni Rotterdam. I am currently working on a thesis as the extension of this paper. I first have to replicate the code. However, the package "similaripy" is only for OS, correct? And I used Windows so now I could not install this with pip. Do you have any recommendation as the alternative for "similaripy" now? It is very important for my thesis and I really appreciate your work. I really hope you could help me.

Thanks in advance and look forward to your reply.

Kind regards,
Diep

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.