From a558b91c4fec4960784f048ad97c23fd179d7518 Mon Sep 17 00:00:00 2001 From: jack <2170067548@qq.com> Date: Sun, 3 Nov 2024 17:39:41 +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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/function.py b/function.py index 5c3d0be..a685932 100644 --- a/function.py +++ b/function.py @@ -60,8 +60,7 @@ def load_data(): y = data['outcome'] # 划分训练集和测试集 - X_train, X_test = X.iloc[:300], X.iloc[300:] - y_train, y_test = y.iloc[:300], y.iloc[300:] + X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42) return X_train, X_test, y_train, y_test @@ -88,4 +87,3 @@ if __name__ == "__main__": y_pred = predict_logreg(model, X_test) accuracy = evaluate_model(y_test, y_pred) print(f"Model Accuracy: {accuracy:.4f}") -