MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / y2indicator

Function y2indicator

ann_logistic_extra/ann_train.py:13–18  ·  view source on GitHub ↗
(y, K)

Source from the content-addressed store, hash-verified

11from process import get_data
12
13def y2indicator(y, K):
14 N = len(y)
15 ind = np.zeros((N, K))
16 for i in range(N):
17 ind[i, y[i]] = 1
18 return ind
19
20Xtrain, Ytrain, Xtest, Ytest = get_data()
21D = Xtrain.shape[1]

Callers 1

ann_train.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected