Skip to content

Commit

Permalink
Fix Bugs in MNAR mechanism in both univariate and multivariate
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurMangussi committed Aug 13, 2024
1 parent bcc3a8b commit f2e4a81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 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.61',
version='0.1.62',
keywords=['machine learning', 'preprocessing data'],
packages=find_packages(where="src"),
package_dir={"": "src"},
Expand Down
8 changes: 4 additions & 4 deletions src/mdatagen/multivariate/mMNAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def random(self, missing_rate: int = 10, deterministic:bool = False):
x_miss = np.random.choice(options_xmiss)

if x_miss not in xmiss_multiva:
x_f = self.dataset.loc[:, x_miss].values
x_f = self.dataset.loc[:, x_miss]

if deterministic:
# Observed feature
Expand Down Expand Up @@ -184,7 +184,7 @@ def correlated(self, missing_rate: int = 10, deterministic:bool = False):

N = round(len(self.dataset) * cutK)

x_f = self.dataset.loc[:, x_miss].values
x_f = self.dataset.loc[:, x_miss]

if deterministic:
# Observed feature
Expand Down Expand Up @@ -267,9 +267,9 @@ def median(self, missing_rate: int = 10, deterministic:bool = False):

choice = np.random.choice([0, 1])
if choice == 0:
x_f = self.dataset.loc[g1_index, col].values
x_f = self.dataset.loc[g1_index, col]
else:
x_f = self.dataset.loc[g2_index, col].values
x_f = self.dataset.loc[g2_index, col]

if deterministic:
# Observed feature
Expand Down
2 changes: 1 addition & 1 deletion src/mdatagen/univariate/uMNAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def run(self, deterministic:bool = False):
"""

x_f = self.dataset.loc[:, self.x_miss].values
x_f = self.dataset.loc[:, self.x_miss]

if deterministic:
# Observed feature
Expand Down

0 comments on commit f2e4a81

Please sign in to comment.