更新 function.py
Gitea Actions Experiment Test / Experiment-Actions (push) Successful in 40s

This commit is contained in:
2024-11-13 15:50:19 +08:00
parent ff29b83efc
commit fbd99e7e87
+1 -1
View File
@@ -129,7 +129,7 @@ def k_fold_cross_validation(X, y, k=5, learning_rate=0.001, iterations=10000, ba
y_train = np.concatenate((y[:val_start], y[val_end:])) y_train = np.concatenate((y[:val_start], y[val_end:]))
models = [] # 存储每个模型 models = [] # 存储每个模型
n_models = 5 # 设定模型数量 n_models = 50 # 设定模型数量
for _ in range(n_models): for _ in range(n_models):
# 从训练集中随机采样,允许重复 # 从训练集中随机采样,允许重复
X_sample, _, y_sample, _ = train_test_split(X_train, y_train, test_size=0.5, random_state=None) X_sample, _, y_sample, _ = train_test_split(X_train, y_train, test_size=0.5, random_state=None)