Coder Social home page Coder Social logo

aai-institute / kyle Goto Github PK

View Code? Open in Web Editor NEW
12.0 6.0 1.0 12.11 MB

A library for calibrating classifiers and computing calibration metrics

License: Other

Shell 2.63% Python 42.54% Jupyter Notebook 54.57% HTML 0.26%
calibration machine-learning ml-classifiers transferlab

kyle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

anesbenmerzoug

kyle's Issues

Use coveralls instead of static coverage report

I would suggest to remove the static html page from the build, make gh pages host only docs (if not completely dropped in favour of RTD), and use coveralls for (fancy) coverage reports.

Documentation build out of sync wrt pypi

Docs are built from develop => out of sync with releases. I think pages should only be built from master, after a release to pypi. Alternatively, one could maintain versions for all tags, allowing to switch between them, like in read the docs, but doing that manually would be a pita.

HistogramBinning cannot be cloned

Explanation

Instances of HistogramBinning cannot be cloned using sklearn's clone function.
This is relevant because it is used for example in the sklearn cross_val_score function.

This error is due to the HistogramBinning estimator class not following sklearn's requirements for an estimator, specifically this following one:

In addition, every keyword argument accepted by init should correspond to an attribute on the instance. Scikit-learn relies on this to find the relevant attributes to set on an estimator when doing model selection.

How to reproduce

from kyle.calibration.calibration_methods import HistogramBinning
from sklearn import clone

clone(HistogramBinning())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anesbenmerzoug/workdir/repositories/transferlab/experiments-for-the-calibration-paper/venv/lib/python3.9/site-packages/sklearn/base.py", line 84, in clone
    new_object_params = estimator.get_params(deep=False)
  File "/home/anesbenmerzoug/workdir/repositories/transferlab/experiments-for-the-calibration-paper/venv/lib/python3.9/site-packages/sklearn/base.py", line 210, in get_params
    value = getattr(self, key)
AttributeError: 'HistogramBinning' object has no attribute 'bins'

Suggested fix

To fix this we could simply change the HistogramBinning class from:

class HistogramBinning(NetcalBasedCalibration[bn.HistogramBinning]):
    def __init__(self, bins=20):
        super().__init__(bn.HistogramBinning(bins=bins))

to:

class HistogramBinning(NetcalBasedCalibration[bn.HistogramBinning]):
    def __init__(self, bins=20):
        self.bins = bins
        super().__init__(bn.HistogramBinning(bins=bins))

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.