Skip to content

Commit

Permalink
Fix error in FeatureChoice class
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurMangussi committed Aug 13, 2024
1 parent f2e4a81 commit 1ec2241
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='mdatagen',
version='0.1.62',
version='0.1.63',
keywords=['machine learning', 'preprocessing data'],
packages=find_packages(where="src"),
package_dir={"": "src"},
Expand Down
8 changes: 7 additions & 1 deletion src/mdatagen/utils/feature_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ def miss_locations(ordered_id, threshold, N):
highest = [] if threshold == 0 else ordered_id[round(-threshold * N) :]

if isinstance(ordered_id, pd.Series):
pos_xmiss = np.hstack([lowest.index, highest.index])
if len(lowest) == 0:
pos_xmiss = np.hstack([lowest, highest.index])
elif len(highest) == 0:
pos_xmiss = np.hstack([lowest.index, highest])
else:
pos_xmiss = np.hstack([lowest.index, highest.index])

elif isinstance(ordered_id, np.ndarray):
pos_xmiss = np.hstack([lowest, highest])
else:
Expand Down

0 comments on commit 1ec2241

Please sign in to comment.