n_missing_for_this_col = n_missing_for_each_column[col_idx]
if n_missing_for_this_col > 0: // if we have any missing data at all
observed_row_mask_for_col = observed_mask[:, col_idx]
other_cols = np.array(list(range(0, col_idx)) + list(range(col_idx + 1, n_cols)))
output = X_filled[observed_row_mask_for_col, col_idx]
if (n_cols - int(self.add_ones) > self.n_nearest_columns):
// probability of column draw is proportional to absolute
// pearson correlation
After Change
abs_correlation_matrix = np.abs(np.corrcoef(X_filled.T))
n_missing_for_each_column = missing_mask.sum(axis=0)
ordered_column_indices = np.arange(n_cols)
for col_idx in visit_indices:
missing_mask_col = missing_mask[:, col_idx] // missing mask for this column
n_missing_for_this_col = n_missing_for_each_column[col_idx]
if n_missing_for_this_col > 0: // if we have any missing data at all
observed_row_mask_for_col = observed_mask[:, col_idx]
output = X_filled[observed_row_mask_for_col, col_idx]
other_cols = np.concatenate([
ordered_column_indices[:col_idx],
ordered_column_indices[col_idx + 1:]
])
if n_original_cols > self.n_nearest_columns:
// probability of column draw is proportional to absolute
// pearson correlation