safe-graph / ugfraud Goto Github PK
View Code? Open in Web Editor NEWAn Unsupervised Graph-based Toolbox for Fraud Detection
License: Apache License 2.0
An Unsupervised Graph-based Toolbox for Fraud Detection
License: Apache License 2.0
Performing a simple import as outlined in testing.py
import sys
import os
__file__ = "~/env/lib/python3.8/site-packages/UGFraud"
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from UGFraud.Demo.eval_fBox import *
However, this produces the below error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
~/env/lib/python3.8/site-packages/UGFraud in <module>
3 __file__ = "~/env/lib/python3.8/site-packages/UGFraud"
4 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
----> 5 from UGFraud.Demo.eval_fBox import *
~/miniconda3/lib/python3.8/site-packages/UGFraud/__init__.py in <module>
1 # -*- coding: utf-8 -*-
2
----> 3 from . import Detector
4 from . import Utils
5
ImportError: cannot import name 'Detector' from partially initialized module 'UGFraud' (most likely due to a circular import) (~/miniconda3/lib/python3.8/site-packages/UGFraud/__init__.py)
good job!! Whether there is a plan for m-zoom and d-cube algorithm?
Is the else condition indented wrongly?
def scale_value(value_dict):
"""
Calculate and return a dict of the value of input dict scaled to (0, 1)
"""
ranked_dict = [(user, value_dict[user]) for user in value_dict.keys()]
ranked_dict = sorted(ranked_dict, reverse=True, key=lambda x: x[1])
up_max, up_mean, up_min = ranked_dict[0][1], ranked_dict[int(len(ranked_dict) / 2)][1], ranked_dict[-1][1]
scale_dict = {}
for i, p in value_dict.items():
norm_value = (p - up_min) / (up_max - up_min)
if norm_value == 0: # avoid the 0
scale_dict[i] = 0 + 1e-7
elif norm_value == 1: # avoid the 1
scale_dict[i] = 1 - 1e-7
else:
scale_dict[i] = norm_value
return scale_dict
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.