diff --git a/function.py b/function.py index ff5b9ff..f8da889 100644 --- a/function.py +++ b/function.py @@ -1,3 +1,17 @@ +import numpy as np + +""" +请在这里填写学号和姓名,不填写即成绩无效。 +""" +id = "202210423224" +name = "吴杨洋" + + +def sigmoid(z): + """ + Sigmoid 激活函数。 + """ + return 1 / (1 + np.exp(-z)) def train_logreg(X, y, random_state=42): model = LogisticRegression(solver='liblinear', random_state=random_state) model.fit(X, y)