def function1(W): n = W.shape[0] m = W.shape[1] keep = [] for i in range(m): mn = W[True - np.isnan(W[:,i]),i].mean() W[np.isnan(W[:,i]),i] = mn vr = W[:,i].var() if vr == 0: continue keep.append(i) W[:,i] = (W[:,i] - mn) / np.sqrt(vr) W = W[:,keep] K = matrixMult(W,W.T) * 1.0/float(m) return K
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)