Skip to content

Commit

Permalink
Extended documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
perellonieto committed May 2, 2024
1 parent 2be5562 commit 63d0baf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
3 changes: 3 additions & 0 deletions docs/source/api/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ Calibration methods
.. automodule:: pycalib.models
:members:

.. automodule:: pycalib.models.calibrators
:members:

21 changes: 17 additions & 4 deletions docs/source/usage/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@
Installation
============

In order to install PyCalib
There are multiple ways to install PyCalib. The simplest way is to use the
packaged version available in the Python Package Index PyPI. Further details of
the packaged version can be found at https://pypi.org/project/pycalib/

```
pip install pycalib
```
In order to install PyCalib from PyPI just run the following command

.. code-block:: bash
pip install pycalib
This will install the library into your current Python environment. You can
check that the library is available in your environment by running

.. code-block:: bash
python -c "import pycalib; print(pycalib.__version__)"
which if successful should print the installed version in the standard output.
28 changes: 15 additions & 13 deletions docs/source/usage/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ following:

First choose the calibration method you want to use

```
from pycalib.models import IsotonicCalibration
cal = IsotonicCalibration()
```
.. code-block:: python
from pycalib.models import IsotonicCalibration
cal = IsotonicCalibration()
Now we can put together a probabilistic classifier with the chosen calibration
method

```
from pycalib.models import CalibratedModel
.. code-block:: python
from pycalib.models import CalibratedModel
cal_clf = CalibratedModel(base_estimator=clf, method=cal)
```
cal_clf = CalibratedModel(base_estimator=clf, calibrator=cal)
Now you can train both classifier and calibrator all together.

```
from sklearn.datasets import load_iris
.. code-block:: python
from sklearn.datasets import load_iris
dataset = load_iris()
cal_clf.fit(dataset.data, dataset.target)
dataset = load_iris()
cal_clf.fit(dataset.data, dataset.target)
```
For a full example check the Section Examples quick start.

0 comments on commit 63d0baf

Please sign in to comment.