mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Added docstring/documentation for sigmoid_function (#10756)
* Added doctest for sigmoid_function * Added doctest for sigmoid_function * Added doctest for sigmoid_function
This commit is contained in:
parent
abd6bca074
commit
dc4e89805a
|
@ -28,6 +28,21 @@ from sklearn import datasets
|
|||
|
||||
|
||||
def sigmoid_function(z):
|
||||
"""
|
||||
Also known as Logistic Function.
|
||||
|
||||
1
|
||||
f(x) = -------
|
||||
1 + e⁻ˣ
|
||||
|
||||
The sigmoid function approaches a value of 1 as its input 'x' becomes
|
||||
increasing positive. Opposite for negative values.
|
||||
|
||||
Reference: https://en.wikipedia.org/wiki/Sigmoid_function
|
||||
|
||||
@param z: input to the function
|
||||
@returns: returns value in the range 0 to 1
|
||||
"""
|
||||
return 1 / (1 + np.exp(-z))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user