Giter Club home page Giter Club logo

Comments (3)

Coder-Yu avatar Coder-Yu commented on June 24, 2024

I just have the code for this part in another paper of mine https://arxiv.org/abs/2209.02544

For your reference

def group_evaluation(self,recList,top):
     popularity = {}
     for item in self.data.training_set_i:
         popularity[item] = len(self.data.training_set_i[item])
     testset = []
     for user in self.data.test_set:
         for item in self.data.test_set[user]:
             if item in popularity:
                 testset.append((user,item,popularity[item]))
     testset = sorted(testset,key=lambda d:d[2])
     p_idx = np.linspace(0,len(testset),11)
     p_idx = [round(n) for n in p_idx]
     groups = []
     for i in range(10):
         group = {}
         for user in recList:
             group[user]={}
         for k in testset[p_idx[i]:p_idx[i + 1]]:
             group[k[0]][k[1]] = 1
         groups.append(group)
     measures=[]
     for group in groups:
         ms = ranking_evaluation_group(group, recList, self.data.test_set,top)
         measures.append(ms)

from qrec.

ksh960910 avatar ksh960910 commented on June 24, 2024

Thanks for the reference, however can I also get the code for 'ranking_evaluation_group' function?
I'm also having trouble getting recall scores from each groups.
I would really appreciate it. Thanks

Best,
Joe

from qrec.

Coder-Yu avatar Coder-Yu commented on June 24, 2024

The core code has been provided. Do it yourself

from qrec.

Related Issues (20)

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.