From cbc2162a6f8a602bb6c732eadd11f7932336bed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=9D=A8=E6=B4=8B?= <2445091977@qq.com> Date: Sat, 2 Nov 2024 21:26:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20function.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)