We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abd6bca commit dc4e898Copy full SHA for dc4e898
machine_learning/logistic_regression.py
@@ -28,6 +28,21 @@
28
29
30
def sigmoid_function(z):
31
+ """
32
+ Also known as Logistic Function.
33
+
34
+ 1
35
+ f(x) = -------
36
+ 1 + e⁻ˣ
37
38
+ The sigmoid function approaches a value of 1 as its input 'x' becomes
39
+ increasing positive. Opposite for negative values.
40
41
+ Reference: https://en.wikipedia.org/wiki/Sigmoid_function
42
43
+ @param z: input to the function
44
+ @returns: returns value in the range 0 to 1
45
46
return 1 / (1 + np.exp(-z))
47
48
0 commit comments