length_err_pct = np.divide( pred_length, true_length, out=np.zeros_like(pred_length), where=true_length!=0)
sel = np.random.choice(testX.shape[0], samples, replace=False)
np.savetxt(phasefile,phase,fmt='%.6f')
for line in itertools.zip_longest( *plants, fillvalue=''):
f.write('%s %s\n' % line)
yimg = Image.fromarray((out * 255).astype(np.uint8))
yimg.save('nnout.jpg')
List struct fields: S.dtype.fields
evr = model.explained_variance_ratio_
cumulative_evr = np.cumsum(evr)
# Number of components needed to explain 95% of variance.
np.argmax( cumulative_evr >= 0.95 ) + 1