Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _visualize(self, data, out_name):
contrast_matrix = pd.DataFrame({c['name']: c['weights'][0]
for c in self.inputs.contrast_info})
all_cols = list(data.columns)
evs = set(contrast_matrix.index)
if set(contrast_matrix.index) != all_cols[:len(evs)]:
ev_cols = [col for col in all_cols if col in evs]
confound_cols = [col for col in all_cols if col not in evs]
data = data[ev_cols + confound_cols]
plot_and_save(out_name, plot_corr_matrix,
data.drop(columns='constant').corr(),
len(evs))
def _visualize(self, data, out_name):
from matplotlib import pyplot as plt
plt.set_cmap('viridis')
plot_and_save(out_name, nis.reporting.plot_design_matrix, data)