Giter Site home page Giter Site logo

open-risk / concentrationmetrics Goto Github PK

View Code? Open in Web Editor NEW
41.0 4.0 15.0 696 KB

A python library for the computation of various concentration, inequality and diversity indices

Home Page: https://www.openriskmanual.org/wiki/Concentration_Index

License: MIT License

Python 94.48% Makefile 0.36% R 4.79% Shell 0.38%
concentration inequality python diversity index shannon hacktoberfest

concentrationmetrics's Issues

Document installation

This looks like a fine library! I think it can help me a lot.

Alas, I don't know how to get it. Your documentation doesn't state how to get it, it just starts with import concentrationMetrics as cl. But neither concentrationMetrics nor concentrationmetrics (package names should be all lower-case as per PEP8!) exist on PyPI. If you want users to download a script you should tell them.

Error instead of termination

If input criteria are not of the expected form (such as that the input is not a numpy array), the object throws a message and then terminates the execution. Neither is standard or desirable. Instead, the object should throw an exception (probably AttributeError) and nothing else.

Gini formula looks wrong (but works)

Looking for the formula here http://www.openriskmanual.org/wiki/Gini_Index

image

It seem that this code is wrong (but it works perfectly)

(1.0 - 2.0 * np.multiply(i, weights).sum())/n + 1.0

I think the right code would be:

(2.0 * np.multiply(i/n, weights).sum()) - (n - 1.0)/n

or following the other formula

image

(n + 1.0)/n - (2.0 * np.multiply((n + 1 - i)/n, weights).sum())

Those two codes that match the formulas have a problem, they get the results as negative numbers

.

.

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.