Skip to content

Commit

Permalink
Merge pull request #4058 from ajdapretnar/calibrated-learner
Browse files Browse the repository at this point in the history
Calibrated Learner: basic docs
  • Loading branch information
janezd authored Oct 1, 2019
2 parents af432aa + 6d2c067 commit 05b3cdb
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 19 deletions.
38 changes: 19 additions & 19 deletions doc/visual-programming/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Model

widgets/model/constant
widgets/model/cn2ruleinduction
widgets/model/calibratedlearner
widgets/model/knn
widgets/model/tree
widgets/model/randomforest
Expand All @@ -105,6 +106,24 @@ Model
widgets/model/savemodel


Evaluate
--------

.. toctree::
:maxdepth: 1

widgets/evaluate/calibrationplot
widgets/evaluate/confusionmatrix
widgets/evaluate/liftcurve
widgets/evaluate/predictions
widgets/evaluate/rocanalysis
widgets/evaluate/testandscore


.. toctree::
:maxdepth: 1


Unsupervised
------------

Expand All @@ -128,22 +147,3 @@ Unsupervised
widgets/unsupervised/manifoldlearning
widgets/unsupervised/selforganizingmap


Evaluate
--------

.. toctree::
:maxdepth: 1

widgets/evaluate/calibrationplot
widgets/evaluate/confusionmatrix
widgets/evaluate/liftcurve
widgets/evaluate/predictions
widgets/evaluate/rocanalysis
widgets/evaluate/testandscore


.. toctree::
:maxdepth: 1


45 changes: 45 additions & 0 deletions doc/visual-programming/source/widgets/model/calibratedlearner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Calibrated Learner
==================

Wraps another learner with probability calibration and decision threshold optimization.

**Inputs**

- Data: input dataset
- Preprocessor: preprocessing method(s)
- Base Learner: learner to calibrate

**Outputs**

- Learner: calibrated learning algorithm
- Model: trained model using the calibrated learner

This learner produces a model that calibrates the distribution of class probabilities and optimizes decision threshold. The widget works only for binary classification tasks.

![](images/Calibrated-Learner-stamped.png)

1. The name under which it will appear in other widgets. Default name is composed of the learner, calibration and optimization parameters.
2. Probability calibration:

- [Sigmoid calibration](http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.41.1639)
- [Isotonic calibration](https://scikit-learn.org/stable/auto_examples/plot_isotonic_regression.html)
- No calibration

3. Decision threshold optimization:

- Optimize classification accuracy
- Optimize F1 score
- No threshold optimization

4. Press *Apply* to commit changes. If *Apply Automatically* is ticked, changes are committed automatically.

Example
-------

A simple example with **Calibrated Learner**. We are using the *titanic* data set as the widget requires binary class values (in this case they are 'survived' and 'not survived').

We will use [Logistic Regression](logisticregression.md) as the base learner which will we calibrate with the default settings, that is with sigmoid optimization of distribution values and by optimizing the CA.

Comparing the results with the uncalibrated **Logistic Regression** model we see that the calibrated model performs better.

![](images/Calibrated-Learner-Example.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 05b3cdb

Please sign in to comment.