expit#
- scikitplot.experimental._cy_experimental.expit(x0)#
Compute the sigmoid (expit) of a scalar input.
The sigmoid function maps a real-valued input to the interval (0, 1) and is defined as:
\[\operatorname{expit}(x) = \frac{1}{1 + e^{-x}}\]This function is widely used in logistic regression and other models in machine learning and statistics.
- Parameters:
- x0dfg_number_t
Scalar input value. Can be of type
float
,double
, orlong double
.
- Returns:
- dfg_number_t
The sigmoid of the input value, with the same type as
x0
.
Notes
This is a Cython-accelerated implementation using the
dfg_number_t
typedef, which controls the precision (e.g.,float
,double
, orlong double
).Added in version 0.3.9.
Examples
>>> expit(0.0) 0.5
>>> expit(0.5) 0.6224593312018546