Giter VIP home page Giter VIP logo

py_mob's People

Contributors

statcompute avatar

Stargazers

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

Watchers

 avatar  avatar

py_mob's Issues

Missing Component Functions

AttributeError: module 'py_mob' has no attribute 'pd_bin

AttributeError: module 'py_mob' has no attribute 'pd_woe'

I cannot find these two functions in py_mob.py

I have installed the package as specified on the webpage

py_mob func iso_bin, IndexError For List.

py_mob/py_mob/py_mob.py

Lines 393 to 427 in 91ff2a2

_p = sorted([_[1] for _ in [l for l in _l3 if l[2] < 1 and l[2] > 0 and l[3] > 10]])[1:-1]
_l4 = sorted(manual_bin(_x, _y, _p), key = lambda x: x["bads"] / x["freq"])
if len([_ for _ in _data if _[2] == 0]) > 0:
_m1 = miss_bin([_[1] for _ in _data if _[2] == 0])
if _m1["bads"] == 0:
for _ in ['freq', 'miss', 'bads']:
_l4[0][_] = _l4[0][_] + _m1[_]
elif _m1["freq"] == _m1["bads"]:
for _ in ['freq', 'miss', 'bads']:
_l4[len(_l4) - 1][_] = _l4[len(_l4) - 1][_] + _m1[_]
else:
_l4 = [_m1] + _l4
_l5 = sorted([{**_,
"rate": round(_["bads"] / _["freq"], 4),
"woe" : round(numpy.log((_["bads"] / _bads) / ((_["freq"] - _["bads"]) / (_freq - _bads))), 4),
"iv" : round((_["bads"] / _bads - (_["freq"] - _["bads"]) / (_freq - _bads)) *
numpy.log((_["bads"] / _bads) / ((_["freq"] - _["bads"]) / (_freq - _bads))), 4)}
for _ in _l4], key = lambda x: x["bin"])
for _ in _l5:
if _["bin"] == 0:
_["rule"] = "numpy.isnan($X$)"
elif _["bin"] == len(_p) + 1:
if _["miss"] == 0:
_["rule"] = "$X$ > " + str(_p[-1])
else:
_["rule"] = "($X$ > " + str(_p[-1]) + ") or numpy.isnan($X$)"
elif _["bin"] == 1:
if _["miss"] == 0:
_["rule"] = "$X$ <= " + str(_p[0])
else:
_["rule"] = "($X$ <= " + str(_p[0]) + ") or numpy.isnan($X$)"

 _p = sorted([_[1] for _ in [l for l in _l3 if l[2] < 1 and l[2] > 0 and l[3] > 10]])[1:-1] 

if sorted([_[1] for _ in [l for l in _l3 if l[2] < 1 and l[2] > 0 and l[3] > 10]]) is short than 3
just like [0, 1], cut [1:-1] to _p will be []

_["rule"] = "$X$ > " + str(_p[-1]) 

or

_["rule"] = "$X$ <= " + str(_p[0])

will be

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: list index out of range

bin function end, some statement can be a function && others.

  • bin function end, some statement can be a function.

py_mob/py_mob/py_mob.py

Lines 293 to 309 in cda0147

for _ in _l5:
if _["bin"] == 0:
_["rule"] = "numpy.isnan($X$)"
elif _["bin"] == len(_l3) + 1:
if _["miss"] == 0:
_["rule"] = "$X$ > " + str(_l3[-1])
else:
_["rule"] = "($X$ > " + str(_l3[-1]) + ") or numpy.isnan($X$)"
elif _["bin"] == 1:
if _["miss"] == 0:
_["rule"] = "$X$ <= " + str(_l3[0])
else:
_["rule"] = "($X$ <= " + str(_l3[0]) + ") or numpy.isnan($X$)"
else:
_["rule"] = "($X$ > " + str(_l3[_["bin"] - 2]) + ") and ($X$ <= " + str(_l3[_["bin"] - 1]) + ")"
_sel = ["bin", "freq", "miss", "bads", "rate", "woe", "iv", "rule"]

  • Nice.

py_mob/py_mob/py_mob.py

Lines 189 to 190 in cda0147

_l1 = sorted(zip(_g, _x, _y), key = lambda x: x[0])
_l2 = zip(set(_g), [[l for l in _l1 if l[0] == g] for g in set(_g)])

  • trying to run data.

  • BTW, the new bin function(kmn_bin、gbm_bin) it is great.

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.