Slide 35
Slide 35 text
9
1
痥 4 畍 㹋鄲 4.3 ،ٝ؟ٝـٕ㷕统
1: np.random.seed(0)
2: np.random.choice(np.arange(0, X.shape[1], 1), \
3: size=int(X.shape[1]*0.7), replace=False)
㎫ 4.28: 杅䖇ꓪסꈷ䫘 (ꓨ鏿ם)
杅䖇ꓪסꈷ䫘מֵגזיעꓨ鏿םַֹמꈷצגַסךյ㎫ 4.28 ךע
np.random.choice ס؛وب٘٤ס replace False כױגն
ױגյ㳔肪ס갾מꈷ䫘ג杅䖇ꓪע◙廠ס갾מ氠ַ䖩锡ֵֿסךյ㳔
肪㊭ס㜟俙כי媘יֽׂ䖩锡ֵֿױն
1: select_features = []
2:
3: np.random.seed(0)
4: select_features.append(np.random.choice(np.arange(0, \
5: X.shape[1], 1), size=int(X.shape[1]*0.7), replace=False))
6: select_features.append(np.random.choice(np.arange(0, \
7: X.shape[1], 1), size=int(X.shape[1]*0.7), replace=False))
8: select_features.append(np.random.choice(np.arange(0, \
9: X.shape[1], 1), size=int(X.shape[1]*0.7), replace=False))
10:
11: print(select_features)
91