fraudar package

A wrapper of Fraudar algorithm for the review graph mining project.

The Fraudar has been introduced by Bryan Hooi, et al. in ACM SIGKDD 2016 Conference on Knowledge Discovery & Data Mining (KDD 2016).

This package exports ReviewGraph class, which implements interfaces expected in other APIs of Review Graph Mining project, and three sub algorithms used in FRAUDER:

ReviewGraph takes keyword argument algo to be set the sub algorithm to be used.

Submodules

fraudar.graph module

Provide a review graph which runs Fraudar algorithm.

class fraudar.graph.Product(graph, name)[source]

Bases: fraudar.graph._Node

A node type representing a product.

Use ReviewGraph.new_product() to create a new product object instead of using this constructor directory.

Parameters:
  • graph – graph object this product belongs to.
  • name – name of this product.
name

name of this product.

summary

summary of ratings given to this product.

summary

Summary of ratings given to this product.

class fraudar.graph.ReviewGraph(blocks=1, algo=<function logWeightedAveDegree>)[source]

Bases: object

ReviewGraph is a simple bipartite graph representing review relation.

Parameters:
reviewers

collection of reviewers.

products

collection of products.

reviews

dictionaly of which key is a product and value is another dictionaly of which key is a reviewer and value is a rating from the reviewer to the product.

add_review(reviewer, product, rating, _time=None)[source]

Add a review from a reviewer to a product.

Parameters:
  • reviewer – reviewer who posts the review.
  • product – product which receives the review.
  • rating – the review score.
Returns:

added review score.

new_product(name)[source]

Create a new product.

Parameters:name – name of the new product.
Returns:a new product object.
new_reviewer(name, **_kwargs)[source]

Create a new reviewer.

Parameters:name – name of the new reviewer.
Returns:a new reviewer object.
update()[source]

Update anomalous scores by running a greedy algorithm.

Returns:0
class fraudar.graph.Reviewer(graph, name, anomalous_score=0)[source]

Bases: fraudar.graph._Node

A node type representing a reviewer.

Use ReviewGraph.new_reviewer() to create a new reviewer object instead of using this constructor directory.

Parameters:
  • graph – graph object this reviewer belongs to.
  • name – name of this reviewer.
name

name of this reviewer.

anomalous_score

anomalous score of this reviewer.

anomalous_score