scikitplot.cexperimental#

C-Experimental functions and utilities by Python and Cython/Pybind11 Bindings.

This package contains cexperimental functions and utilities for use with Cython/Pybind11 Bindings and Python implementations. The functions provided here are optimized for performance and are implemented using Cython/Pybind11 Bindings to leverage its speed advantages.

This package is intended for cexperimental use. Functionality and APIs may change in future releases.

User guide. See the C-Experimental (experimental) section for further details.

Cython Bindings samples#

C-Experimental API Functions by Cython#

This module provides Cython implementations of several mathematical functions often used in statistical and machine learning contexts, such as the expit (sigmoid) function, its logarithm, and the logit function. These functions are scalar and typed versions of functions commonly found in libraries like scipy.special.

The module leverages Cython’s fused types to handle different numeric types (double, float, long double) in a single function definition, making the code both efficient and flexible.

User guide. See the C-Experimental (experimental) section for further details.

_cy_cexperimental.expit

Compute the sigmoid (expit) of a scalar input.

_cy_cexperimental.log_expit

Compute the natural logarithm of the sigmoid (expit) of a scalar input.

_cy_cexperimental.logit

Compute the logit (inverse sigmoid) of a scalar input.

Pybind11 Bindings samples#

Experimental API Python module that uses C/C++ for numerical computations. Created by Pybind11 bindings.

User guide. See the C-Experimental (experimental) section for further details.

_py_cexperimental.py_print

py_print(message: str = 'Hello, from Pybind11 C++!') -> None

Python samples#

User guide. See the C-Experimental (experimental) section for further details.

_logsumexp.sigmoid

Compute the sigmoid function for the input array x.

_logsumexp.softmax

Compute the softmax function.

_logsumexp.logsumexp

Compute the log of the sum of exponentials of input elements.

_logsumexp.log_softmax

Compute the logarithm of the softmax function.