Skip to content

Commit

Permalink
rename: grn feature selection, transform func, k -> top_k.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoysport2022 committed Mar 25, 2022
1 parent b5359c3 commit 0a12f8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ def fit(self, df, y,column_definition):
self.feature2weight['weight'] = self.weights
print(self.feature2weight)

def transform(self, df, k=10):
ind = list(np.argpartition(self.weights, -k)[-k:])
def transform(self, df, top_k=10):
ind = list(np.argpartition(self.weights, -top_k)[-top_k:])
names = list(np.array(self.new_columns)[ind])
self.selected_df = df.loc[:, names]
return self.selected_df
Expand Down

0 comments on commit 0a12f8b

Please sign in to comment.