Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/lazyprogrammer/machine_learning_examples
/ y2indicator
Function
y2indicator
cnn_class2/util.py:50–55 ·
view source on GitHub ↗
(Y)
Source
from the content-addressed store, hash-verified
48
49
50
def
y2indicator(Y):
51
K = len(set(Y))
52
N = len(Y)
53
I = np.empty((N, K))
54
I[np.arange(N), Y] = 1
55
return
I
Callers
1
main
Function · 0.50
Calls
no outgoing calls
Tested by
no test coverage detected