Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hhromic/python-bcubed
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: NilsRethmeier/python-bcubed
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jul 7, 2017

  1. Fix: precision() returns nan

    If mult_precision(el1, el2, cdict, ldict) = [], i.e. an empty list is returned, then numpy mean produces a nan
    This leads to a nan in the list of means (input to the outer most level mean). The mean of such a list is then also precision = nan.
    Nils Rethmeier
    Nils Rethmeier authored Jul 7, 2017
    Configuration menu
    Copy the full SHA
    3915f2b View commit details
    Browse the repository at this point in the history
  2. FIX: precision() results in nan

    If mult_precision() produces an empty list, the inner mean produces a nan. This results in feeding the outer mean a nan (as a list element), which produces a nan precision)
    2 Possible fixes: (I'm not sure which is better)
    Ignore NaN's: (no match = ignore)
    1. return numpy.nanmean([numpy.mean([mult_precision(el1, el2, cdict, ldict) for el2 in cdict if cdict[el1] & cdict[el2]]) for el1 in cdict])
    Replace inner nans with 0: (no/zero set overlap = 0)
    2. return numpy.mean([numpy.nan_to_num(numpy.mean([mult_precision(el1, el2, cdict, ldict) for el2 in cdict if cdict[el1] & cdict[el2]])) for el1 in cdict])
    Nils Rethmeier
    Nils Rethmeier authored Jul 7, 2017
    Configuration menu
    Copy the full SHA
    dc6d1f0 View commit details
    Browse the repository at this point in the history
Loading