绘制对数几率函数python
时间: 2023-09-19 11:11:24 浏览: 93
import numpy as np
import matplotlib.pyplot as plt
def logit(x):
return 1 / (1 + np.exp(-x))
x = np.linspace(-10, 10, 1000)
y = logit(x)
plt.plot(x, y)
plt.xlabel('x')
plt.ylabel('logit(x)')
plt.title('Logistic Function')
plt.show()
阅读全文