$y=frac{1}{1+e^{-(alpha imes x+eta)}}$
alpha越大,曲线越陡峭,beta控制平移
import numpy as np
import pylab as plt
x = np.linspace(-7, 7, 100)
alpha_range = [-1, 0, 1, 2, 1]
beta_range = [-1, 0, 0, 0, 1]
pairs = []
for alpha, beta in zip(alpha_range, beta_range):
y = 1 / (1 + np.exp(- (alpha * x + beta)))
plt.plot(x, y)
pairs.append("alpha=%s,beta=%s" % (alpha, beta))
plt.legend(pairs)
plt.title("y=1/[1+e^(-(alpha*x+beta))]")
plt.show()