Skip to content

Should the indention in line 38-39 be decreased in the code UGFraud/Demo/eval_Fraudar.py? #4

@eatcwt

Description

@eatcwt

Should the indention in line 38-39 be decreased in the code UGFraud/Demo/eval_Fraudar.py?
https://github.com/safe-graph/UGFraud/blob/master/UGFraud/Demo/eval_Fraudar.py
In current code, the p_id would be added into dict only when it is a new node, and the dicts of user_to_product and prod_to_user can not represent the relation between users and products. However, these dicts are only used with their keys, so this might not be a problem.

@timer
def runFraudar(graph, multiple=0):
	new_upriors = node_attr_filter(graph, 'types', 'user', 'prior')
	new_rpriors = edge_attr_filter(graph, 'types', 'review', 'prior')
	# print('Start detection on the new graph with Fraudar')
	user_to_product = {}
	prod_to_user = {}
	u_id_dict = node_attr_filter(graph, 'types', 'user', 'types')
	for u_id in u_id_dict.keys():
		if u_id not in user_to_product:
			user_to_product[u_id] = []
		for p_id in graph[u_id].keys():
			if p_id not in prod_to_user:
				prod_to_user[p_id] = []
				user_to_product[u_id].append(p_id)	# line 38
				prod_to_user[p_id].append(u_id)		# line 39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions