Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
11
from
process
import
get_data
12
13
def
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
20
Xtrain, Ytrain, Xtest, Ytest = get_data()
21
D = Xtrain.shape[1]
Callers
1
ann_train.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected