Giter Club home page Giter Club logo

ugfraud's People

Contributors

chenmetanoia avatar yingtongdou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ugfraud's Issues

cannot import name 'Detector' most likely due to a circular import

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)

m-zoom & d-cube

good job!! Whether there is a plan for m-zoom and d-cube algorithm?

Scale function bug?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.