I'm trying to graph the Sigmoid Function used in machine learning by using the Matplotlib library. My problem is that I haven't visualized a mathematical function before so I'm humbly asking for your guidance.
I've tried to directly plot the following function:
def Sigmoid(x):
a=[]
for i in x:
a.append(1/(1+math.exp(-i)))
return a
using the command plt.plot(Sigmoid).
But that gave me the error:
TypeError: float() argument must be a string or a number, not 'function'
The final result should look something like this:


plot.plot(Sigmoid(10))range(10), not10.x = np.linspace(-5, 5) y = Sigmoid(x). Apparently, I had to define an interval range for the x-axis and let y be the function itself. This means that for every value the function ouputs, Matplotlib will graph it on the interval -5<x<5...