Exemple #1
0
 def setUp(self):
     """Set up for tests.
     """
     self.graph = bipartite.BipartiteGraph()
     self.reviewers = [
         self.graph.new_reviewer("reviewer-{0}".format(i)) for i in range(2)]
     self.products = [
         self.graph.new_product("product-{0}".format(i)) for i in range(3)]
     self.reviews = defaultdict(dict)
     for i, r in enumerate(self.reviewers):
         for j in range(i, len(self.products)):
             self.reviews[i][j] = self.graph.add_review(
                 r, self.products[j], 0.1 if i == 0 else 0.8)
Exemple #2
0
    def setUp(self):
        """Set up a sample graph.
        """
        self.graph = bipartite.BipartiteGraph()
        self.reviewers = [
            self.graph.new_reviewer("reviewer-{0}".format(i)) for i in range(2)
        ]
        self.products = [
            self.graph.new_product("product-{0}".format(i)) for i in range(3)
        ]
        for i, r in enumerate(self.reviewers):
            for j in range(i, len(self.products)):
                self.graph.add_review(r, self.products[j], 0.3)

        self.credibility = credibility.GraphBasedCredibility(self.graph)
Exemple #3
0
 def setUp(self):
     """Set up a bipartite graph.
     """
     self.graph = bipartite.BipartiteGraph()
Exemple #4
0
 def setUp(self):
     """Set up a bipartite graph.
     """
     self.alpha = 2
     self.graph = bipartite.BipartiteGraph(alpha=self.alpha)
Exemple #5
0
 def setUp(self):
     """Set up for tests.
     """
     self.graph = bipartite.BipartiteGraph()