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

Function y2indicator

cnn_class2/fashion2.py:18–23  ·  view source on GitHub ↗
(Y)

Source from the content-addressed store, hash-verified

16
17# helper
18def y2indicator(Y):
19 N = len(Y)
20 K = len(set(Y))
21 I = np.zeros((N, K))
22 I[np.arange(N), Y] = 1
23 return I
24
25
26# get the data

Callers 1

fashion2.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected