8e958d70fa54c0b249f7e6de27fd57cbaa7563d4,algorithm/rating/SlopeOne.py,SlopeOne,predict,#SlopeOne#Any#Any#,29

Before Change


        itemDict = {}
        // check if the user existed in trainSet or not
        if self.dao.containsUser(u):
            for item in self.dao.row(u).valuse():
                if item.values() > 0:
                    itemDict[item] = item.values()
                else:
                    continue
            sum = 0
            freqSum = 0
            for item2 in itemDict.keys():
                sum = sum + ((itemDict[item2] + self.diffAverage[u][item2]) * self.freq[u][item2])

After Change


                count = self.freq[i][item]
                sum += (rating + diff) * count
                freqSum += count
            try:
                pred = float(sum)/freqSum
            except ZeroDivisionError:
                pred = self.dao.userMeans[u]
        elif self.dao.containsItem(i):
            pred = self.dao.itemMeans[i]
        else:
            pred = self.dao.globalMean
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: Coder-Yu/RecQ
Commit Name: 8e958d70fa54c0b249f7e6de27fd57cbaa7563d4
Time: 2016-11-13
Author: fqq0429@gmail.com
File Name: algorithm/rating/SlopeOne.py
Class Name: SlopeOne
Method Name: predict


Project Name: home-assistant/home-assistant
Commit Name: 2a210607d392cac85bb82dd576877ddb192c85c5
Time: 2018-08-16
Author: prokhorov.max@outlook.com
File Name: homeassistant/components/wemo.py
Class Name:
Method Name: setup


Project Name: regel/loudml
Commit Name: e57e91a650fe62f1033da5aa66ff114a67cf69e9
Time: 2018-05-18
Author: vianney@redmintnetwork.fr
File Name: loudml/loudml/storage.py
Class Name: Storage
Method Name: load_model_hooks


Project Name: home-assistant/home-assistant
Commit Name: 6354399d55688a77359c78b3d9914d001208af7e
Time: 2016-04-28
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/automation/__init__.py
Class Name:
Method Name: _process_if