# Copyright (c) 2016-2017 Junpei Kawamoto
# This file is part of rgmining-ria.
# rgmining-ria is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# rgmining-ria is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with rgmining-ria. If not, see <http://www.gnu.org/licenses/>.
"""Provide a review graph which implement One algorithm.
In One algorithm, only one updating scores is allowed. Thus, the review graph
defined in this module overwrites :meth:`ria.bipartite.BipartiteGraph.update`
so that it works only one time.
from __future__ import absolute_import
from ria import bipartite
"""Bipartite graph implementing One algorithm.
updated: Whether :meth:`update` has been called. If True, that method does
def __init__(self, **kwargs):
self.updated = False
[docs] def update(self):
"""Update reviewers' anomalous scores and products' summaries.
maximum absolute difference between old summary and new one, and
old anomalous score and new one.
res = super(BipartiteGraph, self).update()
self.updated = True