import numpy as np
import matplotlib.pyplot as pltdef sigmoid(x):return 1/(1np.exp(-x))x np.linspace(-5,5,100)
y sigmoid(x)plt.plot(x,y,colorgreen)
#损失函数
from sklearn import datasets
from sklearn.linear_model import LogisticRegression
from mpl_toolki…