Skip to content

Commit

Permalink
Merge pull request #655 from learning1112/patch-1
Browse files Browse the repository at this point in the history
Update 7.md(是的,感谢!存在这种可能性)
  • Loading branch information
jiangzhonglian authored Nov 12, 2024
2 parents c248065 + c505389 commit 29dae14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ml/7.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def cross_validation_split(dataset, n_folds):
fold_size = len(dataset) / n_folds
for i in range(n_folds):
fold = list() # 每次循环 fold 清零,防止重复导入 dataset_split
while len(fold) < fold_size: # 这里不能用 if,if 只是在第一次判断时起作用,while 执行循环,直到条件不成立
while len(fold) < fold_size and len(dataset_copy) > 0: # 这里不能用 if,if 只是在第一次判断时起作用,while 执行循环,直到条件不成立
           # 有放回的随机采样,有一些样本被重复采样,从而在训练集中多次出现,有的则从未在训练集中出现,此为自助采样法。从而保证每棵决策树训练集的差异性            
index = randrange(len(dataset_copy))
# 将对应索引 index 的内容从 dataset_copy 中导出,并将该内容从 dataset_copy 中删除。
Expand Down

0 comments on commit 29dae14

Please sign in to comment.