MCPcopy Create free account
hub / github.com/MingchaoZhu/DeepLearning / bootstrap_sample

Function bootstrap_sample

code/chapter7.py:183–186  ·  view source on GitHub ↗
(X, Y)

Source from the content-addressed store, hash-verified

181
182#####---Bagging--#####
183def bootstrap_sample(X, Y):
184 N, M = X.shape
185 idxs = np.random.choice(N, N, replace=True)
186 return X[idxs], Y[idxs]
187
188class BaggingModel(object):
189

Callers 1

fitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected