features_i_df = pd.read_csv(self.subset_i, sep="\t", header=0)
if isinstance(X, pd.DataFrame): // use columns" names
self.feature_names = list(X.columns.values)
feature_i = [str(val) for val in features_i_df.values.flatten()]
elif isinstance(X, np.ndarray): // use index
self.feature_names = list(range(X.shape[1]))
feature_i = [int(val) for val in features_i_df.values.flatten()]
After Change
self.sel_subset_name = []
for s in self.sel_subset:
if isinstance(s, int):
self.sel_subset_name.append(subset_df.index[s])
else:
self.sel_subset_name.append(s)
else: // self.sel_subset is a string