Skip to content

Commit 6ccf80e

Browse files
committed
Merge branch 'dev' into Unit_test_FDA
2 parents bb32a5d + ea39436 commit 6ccf80e

File tree

5 files changed

+564
-318
lines changed

5 files changed

+564
-318
lines changed

.vscode/settings.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"python.pythonPath": "./workspace_venv/bin/python3",
3+
"editor.rulers": [
4+
100
5+
],
6+
"python.formatting.provider": "black",
7+
"python.formatting.blackArgs": [
8+
"--line-length=99"
9+
],
10+
"isort.args": [
11+
"--profile",
12+
"black"
13+
],
14+
"[python]": {
15+
"editor.codeActionsOnSave": {
16+
"source.organizeImports": true
17+
}
18+
},
19+
"python.linting.flake8Enabled": true,
20+
"python.linting.flake8Args": [
21+
"--max-line-length=99",
22+
"--ignore=E402,F841,F401,E302,E305",
23+
],
24+
"files.watcherExclude": {
25+
"**/.git/objects/**": true,
26+
"**/.git/subtree-cache/**": true,
27+
"**/notebooks/*/**": true,
28+
"**/node_modules/*/**": true
29+
},
30+
"terminal.integrated.inheritEnv": false,
31+
"python.linting.lintOnSave": false,
32+
"python.languageServer": "Pylance",
33+
"editor.formatOnSave": true,
34+
"terminal.integrated.scrollback": 10000,
35+
"python.linting.pylintEnabled": false,
36+
"python.linting.enabled": true,
37+
"python.testing.pytestArgs": [
38+
"."
39+
],
40+
"python.testing.unittestEnabled": false,
41+
"python.testing.pytestEnabled": true
42+
}

qolmat/benchmark/missing_patterns.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get_sizes_max(values_isna: pd.Series) -> pd.Series:
4444

4545
class _HoleGenerator:
4646
"""
47-
This class implements a method to get indices of observed and missing values.
47+
This abstract class implements the generic method to generate masks according to law of missing
48+
values.
4849
4950
Parameters
5051
----------
@@ -191,9 +192,8 @@ def generate_mask(self, X: pd.DataFrame) -> pd.DataFrame:
191192

192193

193194
class _SamplerHoleGenerator(_HoleGenerator):
194-
"""
195-
This abstract class implements a generic way to generate holes in a dataframe
196-
by sampling 1D hole size distributions.
195+
"""This abstract class implements a generic way to generate holes in a dataframe by sampling 1D
196+
hole size distributions.
197197
198198
Parameters
199199
----------
@@ -401,7 +401,7 @@ def compute_distribution_holes(self, states):
401401
series_id = (states.diff() != 0).cumsum()
402402
series_id = series_id[states]
403403
distribution_holes = series_id.value_counts().value_counts()
404-
# distribution_holes /= distribution_holes.sum()
404+
405405
return distribution_holes
406406

407407
def fit(self, X: pd.DataFrame) -> EmpiricalHoleGenerator:
@@ -430,7 +430,7 @@ def fit(self, X: pd.DataFrame) -> EmpiricalHoleGenerator:
430430
distributions_holes = states.groupby(self.ngroups).apply(
431431
self.compute_distribution_holes
432432
)
433-
distributions_holes = distributions_holes.groupby(level=0).sum()
433+
distributions_holes = distributions_holes.groupby(level=1).sum()
434434
self.dict_distributions_holes[column] = distributions_holes
435435

436436
def sample_sizes(self, column, n_masked):

0 commit comments

Comments
 (0)