def apply_cfs(self, df): y = df.Bugs.values X = df.drop(labels=['Bugs'], axis=1) X = X.values selected_cols = CFS.cfs(X, y) cols = df.columns[[selected_cols]].tolist() cols.append('Bugs') return df[cols], cols
def apply_cfs(df): _cols = df.columns y = df.Bugs.values X = df.drop(labels=['Bugs'], axis=1) X = X.values selected_cols = CFS.cfs(X, y) fss = [] cols = df.columns[[selected_cols]].tolist() cols.append('Bugs') for col in _cols: if col in cols: fss.append(1) else: fss.append(0) return df[cols], cols, fss
def apply_cfs(self, df): _cols = df.columns y = df.Buggy.values X = df.drop(labels=['Buggy'], axis=1) X = X.values selected_cols = CFS.cfs(X, y) fss = [] imp_fss = [] cols = df.columns[[selected_cols]].tolist() cols.append('Buggy') for col in _cols: _pos = cols.index(col) if col in cols else 0 if col in cols: fss.append(1) imp_fss.append(_pos) else: fss.append(0) imp_fss.append(0) return df[cols], cols, fss, imp_fss