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:
Suyash Dongre 2023-10-23 10:57:33 +05:30 committed by GitHub
parent abd6bca074
commit dc4e89805a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))