Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Matgenix/modnet
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrunin committed Apr 2, 2024
2 parents a5e7777 + 622a270 commit 6afc37f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modnet/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ def feature_selection(
drop_thr: float = 0.2,
n_jobs: int = None,
ignore_names: Optional[List] = [],
random_state: int = None,
):
"""Compute the mutual information between features and targets,
then apply relevance-redundancy rankings to choose the top `n`
Expand Down Expand Up @@ -859,7 +860,11 @@ def feature_selection(
else:
df = self.df_featurized.copy()
self.cross_nmi, self.feature_entropy = get_cross_nmi(
df, return_entropy=True, drop_thr=drop_thr, n_jobs=n_jobs
df,
return_entropy=True,
drop_thr=drop_thr,
n_jobs=n_jobs,
random_state=random_state,
)

if self.cross_nmi.isna().sum().sum() > 0:
Expand Down Expand Up @@ -889,6 +894,7 @@ def feature_selection(
df,
df_target,
task_type,
random_state=random_state,
)[name]

LOG.info("Computing optimal features...")
Expand Down

0 comments on commit 6afc37f

Please sign in to comment.