MCPcopy Create free account
hub / github.com/PetarV-/GAT / standardize_data

Function standardize_data

utils/process.py:143–153  ·  view source on GitHub ↗

Standardize feature matrix and convert to tuple representation

(f, train_mask)

Source from the content-addressed store, hash-verified

141 return sparse_mx
142
143def standardize_data(f, train_mask):
144 """Standardize feature matrix and convert to tuple representation"""
145 # standardize data
146 f = f.todense()
147 mu = f[train_mask == True, :].mean(axis=0)
148 sigma = f[train_mask == True, :].std(axis=0)
149 f = f[:, np.squeeze(np.array(sigma > 0))]
150 mu = f[train_mask == True, :].mean(axis=0)
151 sigma = f[train_mask == True, :].std(axis=0)
152 f = (f - mu) / sigma
153 return f
154
155def preprocess_features(features):
156 """Row-normalize feature matrix and convert to tuple representation"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected