missinglab-workbench 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- missinglab_workbench-0.1.0/LICENSE +21 -0
- missinglab_workbench-0.1.0/PKG-INFO +587 -0
- missinglab_workbench-0.1.0/README.md +554 -0
- missinglab_workbench-0.1.0/pyproject.toml +68 -0
- missinglab_workbench-0.1.0/setup.cfg +4 -0
- missinglab_workbench-0.1.0/src/missinglab/__init__.py +0 -0
- missinglab_workbench-0.1.0/src/missinglab/__main__.py +22 -0
- missinglab_workbench-0.1.0/src/missinglab/config.py +1 -0
- missinglab_workbench-0.1.0/src/missinglab/core/__init__.py +0 -0
- missinglab_workbench-0.1.0/src/missinglab/core/analyzer.py +70 -0
- missinglab_workbench-0.1.0/src/missinglab/core/benchmark.py +174 -0
- missinglab_workbench-0.1.0/src/missinglab/core/evaluation.py +138 -0
- missinglab_workbench-0.1.0/src/missinglab/core/imputation.py +176 -0
- missinglab_workbench-0.1.0/src/missinglab/core/imputation_workflow.py +138 -0
- missinglab_workbench-0.1.0/src/missinglab/core/mcar.py +72 -0
- missinglab_workbench-0.1.0/src/missinglab/core/patterns.py +764 -0
- missinglab_workbench-0.1.0/src/missinglab/core/session_report.py +79 -0
- missinglab_workbench-0.1.0/src/missinglab/gui/__init__.py +0 -0
- missinglab_workbench-0.1.0/src/missinglab/gui/app.py +2595 -0
- missinglab_workbench-0.1.0/src/missinglab/io/__init__.py +0 -0
- missinglab_workbench-0.1.0/src/missinglab/io/loader.py +37 -0
- missinglab_workbench-0.1.0/src/missinglab/settings.py +41 -0
- missinglab_workbench-0.1.0/src/missinglab_workbench.egg-info/PKG-INFO +587 -0
- missinglab_workbench-0.1.0/src/missinglab_workbench.egg-info/SOURCES.txt +38 -0
- missinglab_workbench-0.1.0/src/missinglab_workbench.egg-info/dependency_links.txt +1 -0
- missinglab_workbench-0.1.0/src/missinglab_workbench.egg-info/entry_points.txt +2 -0
- missinglab_workbench-0.1.0/src/missinglab_workbench.egg-info/requires.txt +12 -0
- missinglab_workbench-0.1.0/src/missinglab_workbench.egg-info/top_level.txt +1 -0
- missinglab_workbench-0.1.0/tests/test_advanced_evaluation.py +56 -0
- missinglab_workbench-0.1.0/tests/test_analyzer.py +67 -0
- missinglab_workbench-0.1.0/tests/test_benchmark.py +182 -0
- missinglab_workbench-0.1.0/tests/test_evaluation.py +127 -0
- missinglab_workbench-0.1.0/tests/test_imputation.py +190 -0
- missinglab_workbench-0.1.0/tests/test_imputation_workflow.py +137 -0
- missinglab_workbench-0.1.0/tests/test_loader.py +52 -0
- missinglab_workbench-0.1.0/tests/test_mcar.py +47 -0
- missinglab_workbench-0.1.0/tests/test_patterns.py +579 -0
- missinglab_workbench-0.1.0/tests/test_reference.py +26 -0
- missinglab_workbench-0.1.0/tests/test_session_report.py +82 -0
- missinglab_workbench-0.1.0/tests/test_simulation_experiment.py +324 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MissingLab Project Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: missinglab-workbench
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: An offline desktop workbench for missingness simulation, analysis-aware evaluation, and imputation benchmarking
|
|
5
|
+
Author: Ghina El Sabbagh, Clarita Daou
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ghinasabbagh/MissingLab
|
|
8
|
+
Project-URL: Repository, https://github.com/ghinasabbagh/MissingLab
|
|
9
|
+
Project-URL: Documentation, https://github.com/ghinasabbagh/MissingLab/blob/main/README.md
|
|
10
|
+
Project-URL: Issues, https://github.com/ghinasabbagh/MissingLab/issues
|
|
11
|
+
Keywords: missing-data,imputation,data-science,missingness,simulation,statistics,data-quality
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: pandas<3.0,>=2.0
|
|
22
|
+
Requires-Dist: matplotlib<4.0,>=3.7
|
|
23
|
+
Requires-Dist: customtkinter<6.0,>=5.2
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Requires-Dist: scipy
|
|
26
|
+
Requires-Dist: scikit-learn
|
|
27
|
+
Requires-Dist: pyampute
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
31
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# MissingLab — Missing-Data Analysis Workbench
|
|
35
|
+
|
|
36
|
+
MissingLab is an offline desktop Python application designed to help users explore, analyze, simulate, and evaluate missing data without requiring programming experience.
|
|
37
|
+
|
|
38
|
+
Beyond traditional missingness visualization, MissingLab learns missingness patterns from an existing dataset, reproduces these patterns on complete observations, and evaluates their impact on statistical analyses. It also provides numerical and categorical imputation methods and tools to evaluate their accuracy.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
### 1. Dataset Exploration
|
|
43
|
+
|
|
44
|
+
- CSV import with input validation and error handling.
|
|
45
|
+
- Dataset overview and missingness statistics.
|
|
46
|
+
- Missingness percentage by column.
|
|
47
|
+
- Interactive missingness heatmap.
|
|
48
|
+
- Column-level summary, including data types and missing counts.
|
|
49
|
+
|
|
50
|
+
### 2. Missingness Diagnostics
|
|
51
|
+
|
|
52
|
+
- Little's MCAR test for numerical variables.
|
|
53
|
+
- Missingness indicator analysis.
|
|
54
|
+
- Co-missingness analysis using pairwise counts and Jaccard similarity.
|
|
55
|
+
- Numerical and categorical associations with missingness.
|
|
56
|
+
- Identification of potential missingness predictors.
|
|
57
|
+
|
|
58
|
+
Little's MCAR test evaluates the MCAR assumption. Rejecting MCAR does not distinguish MAR from MNAR.
|
|
59
|
+
|
|
60
|
+
### 3. Feature 1 — Learn and Reproduce Missingness Patterns
|
|
61
|
+
|
|
62
|
+
MissingLab supports three simulation methods:
|
|
63
|
+
|
|
64
|
+
- **Baseline:** Samples missingness patterns from their original empirical distribution.
|
|
65
|
+
- **Employment-based:** Samples missingness patterns conditional on employment status.
|
|
66
|
+
- **Random Forest:** Learns conditional missingness patterns using one or more selected predictors.
|
|
67
|
+
|
|
68
|
+
The Random Forest method supports numerical and categorical predictors and includes probability calibration to improve agreement with original missingness pattern frequencies.
|
|
69
|
+
|
|
70
|
+
Simulation results are evaluated using:
|
|
71
|
+
|
|
72
|
+
- Overall missingness percentage.
|
|
73
|
+
- Column-level missingness differences.
|
|
74
|
+
- Missingness pattern frequency differences.
|
|
75
|
+
- Co-missingness differences.
|
|
76
|
+
|
|
77
|
+
Column-level comparison results can be exported as CSV files.
|
|
78
|
+
|
|
79
|
+
### 4. Feature 2 — Analysis-Aware Evaluation
|
|
80
|
+
|
|
81
|
+
Missingness similarity alone does not guarantee that a simulated dataset preserves important statistical relationships.
|
|
82
|
+
|
|
83
|
+
Analysis-Aware Evaluation measures how introducing missingness and applying a missing-data handling method affect analytical results.
|
|
84
|
+
|
|
85
|
+
**Supported analyses:**
|
|
86
|
+
|
|
87
|
+
| Analysis | Metrics |
|
|
88
|
+
|---|---|
|
|
89
|
+
| Descriptive statistics | Mean, median, sample variance |
|
|
90
|
+
| Distribution analysis | Kolmogorov-Smirnov distance |
|
|
91
|
+
| Correlation analysis | Pearson and Spearman correlations |
|
|
92
|
+
| Linear regression | Slope, intercept, R-squared |
|
|
93
|
+
|
|
94
|
+
**Supported missing-data handling methods:**
|
|
95
|
+
|
|
96
|
+
- Complete-case analysis.
|
|
97
|
+
- Mean imputation.
|
|
98
|
+
- Median imputation.
|
|
99
|
+
- K-Nearest Neighbors (KNN) imputation.
|
|
100
|
+
- Iterative imputation.
|
|
101
|
+
|
|
102
|
+
The application displays reference values, analytical results after missing-data handling, and absolute differences.
|
|
103
|
+
|
|
104
|
+
Evaluation results and their associated metadata can be exported as CSV files.
|
|
105
|
+
|
|
106
|
+
### 5. Imputation Methods
|
|
107
|
+
|
|
108
|
+
MissingLab supports four numerical missing-value imputation methods: mean, median, KNN and iterative imputation. Mode imputation is available for categorical and Boolean columns in the direct imputation workspace. All four are available in the desktop GUI for the imported dataset and for Analysis-Aware Evaluation. The GUI exposes the number of neighbors for KNN and the maximum iterations for iterative imputation.
|
|
109
|
+
|
|
110
|
+
Mean and median imputation replace missing numerical values with the corresponding observed column statistic.
|
|
111
|
+
|
|
112
|
+
#### 5.1. K-Nearest Neighbors (KNN)
|
|
113
|
+
|
|
114
|
+
KNN imputation estimates missing numerical values using information from the nearest observations.
|
|
115
|
+
|
|
116
|
+
**Parameters:**
|
|
117
|
+
|
|
118
|
+
- `n_neighbors`: Number of neighboring observations to consider.
|
|
119
|
+
- `weights`: Weighting strategy (`uniform` or `distance`).
|
|
120
|
+
|
|
121
|
+
#### 5.2. Iterative Imputation
|
|
122
|
+
|
|
123
|
+
Iterative imputation estimates missing numerical values by modeling each incomplete column using the other available numerical columns.
|
|
124
|
+
|
|
125
|
+
**Parameters:**
|
|
126
|
+
|
|
127
|
+
- `max_iter`: Maximum number of imputation iterations.
|
|
128
|
+
- `tol`: Convergence tolerance.
|
|
129
|
+
- `initial_strategy`: Initial imputation strategy (`mean`, `median`, or `most_frequent`).
|
|
130
|
+
- `random_state`: Controls reproducibility.
|
|
131
|
+
|
|
132
|
+
**Both methods:**
|
|
133
|
+
|
|
134
|
+
- Preserve the original DataFrame.
|
|
135
|
+
- Leave categorical and Boolean columns unchanged.
|
|
136
|
+
- Leave entirely missing numerical columns unchanged.
|
|
137
|
+
- Reject infinite numerical values.
|
|
138
|
+
- Return a DataFrame with the original structure.
|
|
139
|
+
|
|
140
|
+
### 6. Imputation Evaluation
|
|
141
|
+
|
|
142
|
+
MissingLab includes a benchmarking module that compares imputation methods using:
|
|
143
|
+
|
|
144
|
+
- **MAE (Mean Absolute Error):** Measures the average absolute difference between original and imputed values.
|
|
145
|
+
- **RMSE (Root Mean Squared Error):** Measures the square root of the average squared difference.
|
|
146
|
+
|
|
147
|
+
The benchmark evaluates deliberately hidden cells from a complete reference dataset. Numerical methods use MAE and RMSE; categorical mode imputation uses exact-match accuracy. Numerical and categorical evaluated-cell counts are reported separately.
|
|
148
|
+
|
|
149
|
+
**Example:**
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from missinglab.core.benchmark import benchmark_imputation
|
|
153
|
+
|
|
154
|
+
results = benchmark_imputation(
|
|
155
|
+
reference_df=original_data,
|
|
156
|
+
incomplete_df=incomplete_data,
|
|
157
|
+
imputed_datasets={
|
|
158
|
+
"KNN": knn_result,
|
|
159
|
+
"Iterative": iterative_result
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
print(results)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Lower MAE and RMSE values indicate better imputation accuracy on the evaluated cells. The GUI compares mean, median, KNN, iterative and mode imputation on the same simulated missingness scenario, using independent benchmark parameters. Each method is scored on its applicable cell types; categorical accuracy is not directly comparable with numerical errors. Errors are pooled in original numerical units, so variables with larger scales can dominate the scores.
|
|
167
|
+
|
|
168
|
+
### 7. Exports and Session Reports
|
|
169
|
+
|
|
170
|
+
- Export the imputed dataset as a CSV without modifying the original input.
|
|
171
|
+
- Export the latest completed session results as JSON, including dataset metadata, MCAR diagnostics, simulation settings and results, analysis-aware evaluation, imputation and benchmarking.
|
|
172
|
+
- Record the parameters actually used, software versions, random seeds where applicable, UTC timestamp and report schema version.
|
|
173
|
+
- Exclude raw source, reference, simulated and imputed data rows from the JSON report.
|
|
174
|
+
|
|
175
|
+
The interface uses a coordinated pink theme with a baby pink header and deep pink title.
|
|
176
|
+
|
|
177
|
+
## Evaluation Methodology
|
|
178
|
+
|
|
179
|
+
To isolate the effects of simulated missingness, MissingLab retains the complete observations selected during simulation.
|
|
180
|
+
|
|
181
|
+
The evaluation workflow is:
|
|
182
|
+
|
|
183
|
+
1. Identify complete observations in the original dataset.
|
|
184
|
+
2. Select reference observations for simulation.
|
|
185
|
+
3. Preserve a complete copy of the selected observations.
|
|
186
|
+
4. Introduce learned missingness patterns.
|
|
187
|
+
5. Select an analytical task and numerical variables.
|
|
188
|
+
6. Apply the selected missing-data handling method.
|
|
189
|
+
7. Perform the analysis on the complete reference dataset and the handled simulated dataset.
|
|
190
|
+
8. Compare the analytical results.
|
|
191
|
+
|
|
192
|
+
The reference and simulated datasets contain the same underlying observations before missingness is introduced.
|
|
193
|
+
|
|
194
|
+
All four imputation methods use the simulated dataset only when performing analysis-aware evaluation. Hidden reference values are not used to calculate imputation values.
|
|
195
|
+
|
|
196
|
+
The evaluation reports the number of reference observations, observed complete rows, rows used for analysis, missing cells, and imputed cells.
|
|
197
|
+
|
|
198
|
+
The original source dataset is not modified.
|
|
199
|
+
|
|
200
|
+
## Installation
|
|
201
|
+
|
|
202
|
+
Python 3.10 or later is required.
|
|
203
|
+
|
|
204
|
+
### Install from PyPI (release v0.1.0)
|
|
205
|
+
|
|
206
|
+
After the public release is published:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
python -m pip install missinglab-workbench
|
|
210
|
+
python -m missinglab
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
The source installation below is available for development and testing.
|
|
214
|
+
|
|
215
|
+
### Windows (PowerShell)
|
|
216
|
+
|
|
217
|
+
```powershell
|
|
218
|
+
cd MissingLab
|
|
219
|
+
py -m venv .venv
|
|
220
|
+
.\.venv\Scripts\Activate.ps1
|
|
221
|
+
python -m pip install -e ".[dev]"
|
|
222
|
+
python -m missinglab
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
If PowerShell activation is restricted, use:
|
|
226
|
+
|
|
227
|
+
```powershell
|
|
228
|
+
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
|
229
|
+
.\.venv\Scripts\python.exe -m missinglab
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### macOS / Linux
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
cd MissingLab
|
|
236
|
+
python3 -m venv .venv
|
|
237
|
+
source .venv/bin/activate
|
|
238
|
+
python -m pip install -e ".[dev]"
|
|
239
|
+
python -m missinglab
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
On some Linux systems, install `python3-tk` using the operating system's package manager before launching the application.
|
|
243
|
+
|
|
244
|
+
### Main Dependencies
|
|
245
|
+
|
|
246
|
+
- pandas
|
|
247
|
+
- NumPy
|
|
248
|
+
- SciPy
|
|
249
|
+
- Matplotlib
|
|
250
|
+
- CustomTkinter
|
|
251
|
+
- scikit-learn
|
|
252
|
+
- pyampute
|
|
253
|
+
|
|
254
|
+
Development dependencies include pytest and pytest-cov.
|
|
255
|
+
|
|
256
|
+
## Using MissingLab
|
|
257
|
+
|
|
258
|
+
### 1. Import a Dataset
|
|
259
|
+
|
|
260
|
+
Click **Import dataset** and select a CSV file. Use the sidebar to navigate between Dashboard, Diagnostics, Simulation, Evaluation, Imputation and Reports. See the [user guide](https://github.com/ghinasabbagh/MissingLab/blob/main/docs/user_guide.md) for a complete workflow.
|
|
261
|
+
|
|
262
|
+
The application displays dataset statistics, missingness charts, a heatmap, and a column summary.
|
|
263
|
+
|
|
264
|
+
The provided sample dataset is located at:
|
|
265
|
+
|
|
266
|
+
`examples/sample_missing_data.csv`
|
|
267
|
+
|
|
268
|
+
The sample contains 10 rows, 5 columns, and 8 missing cells (16%).
|
|
269
|
+
|
|
270
|
+
### 2. Run Missingness Diagnostics
|
|
271
|
+
|
|
272
|
+
Click **Run Little's MCAR Test** to evaluate the MCAR assumption using eligible numerical variables.
|
|
273
|
+
|
|
274
|
+
The result includes the p-value, significance level, interpretation, and included and excluded columns.
|
|
275
|
+
|
|
276
|
+
### 3. Simulate Missingness
|
|
277
|
+
|
|
278
|
+
Select one of the available simulation methods.
|
|
279
|
+
|
|
280
|
+
For Random Forest simulation, select one or more relevant predictor variables.
|
|
281
|
+
|
|
282
|
+
Enter the desired number of simulated observations or leave the field empty to use the number of complete observations.
|
|
283
|
+
|
|
284
|
+
Click **Run Simulation**.
|
|
285
|
+
|
|
286
|
+
The application compares original and simulated missingness and displays the results.
|
|
287
|
+
|
|
288
|
+
### 4. Perform Analysis-Aware Evaluation
|
|
289
|
+
|
|
290
|
+
After completing a simulation:
|
|
291
|
+
|
|
292
|
+
1. Select an analysis type.
|
|
293
|
+
2. Select the required numerical variable or variables.
|
|
294
|
+
3. Choose a missing-data handling method and set the relevant parameters if using KNN or iterative imputation.
|
|
295
|
+
4. Click **Run Evaluation**.
|
|
296
|
+
5. Examine the reference values and analytical differences.
|
|
297
|
+
6. Optionally click **Export Evaluation CSV**.
|
|
298
|
+
|
|
299
|
+
For linear regression, the first variable is the predictor and the second variable is the outcome.
|
|
300
|
+
|
|
301
|
+
For correlation analysis, variable order does not affect the correlation coefficients.
|
|
302
|
+
|
|
303
|
+
### 5. Run Imputation Methods
|
|
304
|
+
|
|
305
|
+
In the Imputation workspace, select Mean, Median, KNN, Iterative or Mode. Set the method-specific parameter if applicable, then click **Run Imputation**. Review the number of filled and remaining missing cells, and export the imputed dataset using the CSV export control. Numerical methods leave categorical and Boolean values unchanged; Mode targets categorical and Boolean values rather than numerical columns. Entirely missing numerical columns remain unfilled.
|
|
306
|
+
|
|
307
|
+
The KNN and Iterative imputation methods are also available through the project's core imputation module.
|
|
308
|
+
|
|
309
|
+
They can be imported and used in Python code:
|
|
310
|
+
|
|
311
|
+
```python
|
|
312
|
+
from missinglab.core.imputation import (
|
|
313
|
+
knn_imputation,
|
|
314
|
+
iterative_imputation
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
knn_result = knn_imputation(
|
|
318
|
+
data,
|
|
319
|
+
n_neighbors=5,
|
|
320
|
+
weights="uniform"
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
iterative_result = iterative_imputation(
|
|
324
|
+
data,
|
|
325
|
+
max_iter=10,
|
|
326
|
+
tol=0.001,
|
|
327
|
+
initial_strategy="mean",
|
|
328
|
+
random_state=42
|
|
329
|
+
)
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### 6. Run the Imputation Benchmark
|
|
333
|
+
|
|
334
|
+
After running a missingness simulation, use the Imputation Benchmark section to set KNN neighbors and iterative iterations independently of the other workflows. Click **Run Benchmark** and compare MAE, RMSE, categorical accuracy and evaluated cell counts for the five methods. Only deliberately hidden cells of the relevant type are scored.
|
|
335
|
+
|
|
336
|
+
The benchmarking module also compares imputed datasets against a complete reference dataset.
|
|
337
|
+
|
|
338
|
+
A demonstration script is provided:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
python examples/run_benchmark.py
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
The script demonstrates KNN and Iterative imputation and reports their MAE and RMSE values.
|
|
345
|
+
|
|
346
|
+
### 7. Export a Session Report
|
|
347
|
+
|
|
348
|
+
Click **Export Session Report (JSON)** to save the latest completed results for the current dataset. Unperformed operations appear as null. The export records completed-operation settings rather than unsubmitted changes to the GUI controls. A new dataset clears previous results; a new simulation invalidates dependent evaluation and benchmark results.
|
|
349
|
+
|
|
350
|
+
The report is a reproducibility record, not a session restoration mechanism. Retain the original CSV and compatible software versions to reproduce the results.
|
|
351
|
+
|
|
352
|
+
## Screenshots
|
|
353
|
+
|
|
354
|
+
## Application Screenshots
|
|
355
|
+
|
|
356
|
+
### Dashboard
|
|
357
|
+

|
|
358
|
+
|
|
359
|
+
### Missingness Diagnostics
|
|
360
|
+

|
|
361
|
+
|
|
362
|
+
### Missingness Simulation
|
|
363
|
+

|
|
364
|
+

|
|
365
|
+
|
|
366
|
+
### Analysis-Aware Evaluation
|
|
367
|
+

|
|
368
|
+

|
|
369
|
+
|
|
370
|
+
### Imputation and Benchmarking
|
|
371
|
+

|
|
372
|
+

|
|
373
|
+
|
|
374
|
+
### Reproducible Session Reports
|
|
375
|
+

|
|
376
|
+
|
|
377
|
+
## Automated Testing
|
|
378
|
+
|
|
379
|
+
Run the full test suite:
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
python -m pytest tests/ -v
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
**Latest verified results on Windows with Python 3.12.10 (December 3, 2026):**
|
|
386
|
+
|
|
387
|
+
| Metric | Result |
|
|
388
|
+
|---|---:|
|
|
389
|
+
| Total tests | 153 |
|
|
390
|
+
| Passed tests | 153 |
|
|
391
|
+
| Failed tests | 0 |
|
|
392
|
+
| Code coverage | 90.96% |
|
|
393
|
+
| Runtime | 38.84 seconds |
|
|
394
|
+
| Required coverage | 70% |
|
|
395
|
+
|
|
396
|
+
Coverage is measured for the core and IO modules. GUI functionality is verified separately through manual testing.
|
|
397
|
+
|
|
398
|
+
The test suite covers:
|
|
399
|
+
|
|
400
|
+
- CSV loading and input validation.
|
|
401
|
+
- Dataset analysis.
|
|
402
|
+
- Little's MCAR test.
|
|
403
|
+
- Missingness pattern analysis.
|
|
404
|
+
- Missingness simulation.
|
|
405
|
+
- Simulation reproducibility.
|
|
406
|
+
- Reference observation preservation.
|
|
407
|
+
- Source dataset integrity.
|
|
408
|
+
- Analytical evaluation.
|
|
409
|
+
- Missing-data handling.
|
|
410
|
+
- KNN imputation.
|
|
411
|
+
- Iterative imputation.
|
|
412
|
+
- Imputation benchmarking using MAE and RMSE.
|
|
413
|
+
- Invalid inputs.
|
|
414
|
+
- Numerical and categorical missing-value compatibility.
|
|
415
|
+
- Imputation workflow and source-data preservation.
|
|
416
|
+
- KNN and iterative analysis-aware evaluation.
|
|
417
|
+
- Session report generation, JSON serialization and source-file overwrite protection.
|
|
418
|
+
|
|
419
|
+
A GitHub Actions workflow is included for Windows and Linux CI.
|
|
420
|
+
|
|
421
|
+
The latest test results reported above were verified locally. The final release commit still requires remote CI verification. A separate clean Windows Python 3.12 environment successfully installed the wheel, passed pip check and launched the GUI; dataset import and simulation were manually verified.
|
|
422
|
+
|
|
423
|
+
## Scientific Validation
|
|
424
|
+
|
|
425
|
+
### 1. Missingness Simulation
|
|
426
|
+
|
|
427
|
+
Preliminary simulation validation was conducted using synthetic MCAR, MAR, and Mixed missingness scenarios.
|
|
428
|
+
|
|
429
|
+
Results are stored in:
|
|
430
|
+
|
|
431
|
+
- `simulation_validation_results.csv`
|
|
432
|
+
- `simulation_validation_summary.csv`
|
|
433
|
+
|
|
434
|
+
### 2. Analysis-Aware Evaluation
|
|
435
|
+
|
|
436
|
+
A reproducible synthetic experiment was developed to evaluate the preservation of known analytical relationships.
|
|
437
|
+
|
|
438
|
+
The experiment includes:
|
|
439
|
+
|
|
440
|
+
- 500 source observations per scenario and seed.
|
|
441
|
+
- Five random seeds: 0, 42, 123, 2026, and 999.
|
|
442
|
+
- Three missingness scenarios: MCAR, MAR, and Mixed.
|
|
443
|
+
- Three missingness simulation methods.
|
|
444
|
+
- Three missing-data handling methods.
|
|
445
|
+
- Four analytical comparison types.
|
|
446
|
+
|
|
447
|
+
Run the experiment:
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
python validate_evaluation.py
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
The script generates:
|
|
454
|
+
|
|
455
|
+
- `evaluation_validation_results.csv`
|
|
456
|
+
- `evaluation_validation_summary.csv`
|
|
457
|
+
|
|
458
|
+
The experiment produces 1,215 individual metric results and 243 aggregated summary rows.
|
|
459
|
+
|
|
460
|
+
### 3. Preliminary Findings
|
|
461
|
+
|
|
462
|
+
Mean absolute Pearson correlation differences, averaged across the three simulation methods and five random seeds:
|
|
463
|
+
|
|
464
|
+
| Scenario | Complete-case | Mean imputation | Median imputation |
|
|
465
|
+
|---|---:|---:|---:|
|
|
466
|
+
| MCAR | 0.0043 | 0.1675 | 0.1692 |
|
|
467
|
+
| MAR | 0.0032 | 0.1677 | 0.1688 |
|
|
468
|
+
| Mixed | 0.0041 | 0.1744 | 0.1767 |
|
|
469
|
+
|
|
470
|
+
The experiment demonstrates that reproducing missingness percentages does not necessarily preserve analytical relationships.
|
|
471
|
+
|
|
472
|
+
Complete-case analysis produced smaller correlation differences in this particular synthetic experiment. These findings should not be generalized to all datasets or missingness mechanisms.
|
|
473
|
+
|
|
474
|
+
Additional manual GUI testing was performed using synthetic employment and healthcare datasets.
|
|
475
|
+
|
|
476
|
+
## Project Structure
|
|
477
|
+
|
|
478
|
+
```text
|
|
479
|
+
MissingLab/
|
|
480
|
+
├── .github/
|
|
481
|
+
│ └── workflows/
|
|
482
|
+
│ └── tests.yml
|
|
483
|
+
├── examples/
|
|
484
|
+
│ ├── sample_missing_data.csv
|
|
485
|
+
│ ├── run_benchmark.py
|
|
486
|
+
│ └── README.md
|
|
487
|
+
├── src/
|
|
488
|
+
│ └── missinglab/
|
|
489
|
+
│ ├── core/
|
|
490
|
+
│ │ ├── analyzer.py
|
|
491
|
+
│ │ ├── benchmark.py
|
|
492
|
+
│ │ ├── imputation.py
|
|
493
|
+
│ │ ├── imputation_workflow.py
|
|
494
|
+
│ │ ├── session_report.py
|
|
495
|
+
│ │ ├── mcar.py
|
|
496
|
+
│ │ ├── patterns.py
|
|
497
|
+
│ │ └── evaluation.py
|
|
498
|
+
│ ├── gui/
|
|
499
|
+
│ │ └── app.py
|
|
500
|
+
│ ├── io/
|
|
501
|
+
│ │ └── loader.py
|
|
502
|
+
│ ├── __init__.py
|
|
503
|
+
│ └── __main__.py
|
|
504
|
+
├── tests/
|
|
505
|
+
│ ├── test_analyzer.py
|
|
506
|
+
│ ├── test_loader.py
|
|
507
|
+
│ ├── test_mcar.py
|
|
508
|
+
│ ├── test_patterns.py
|
|
509
|
+
│ ├── test_reference.py
|
|
510
|
+
│ ├── test_evaluation.py
|
|
511
|
+
│ ├── test_simulation_experiment.py
|
|
512
|
+
│ ├── test_imputation.py
|
|
513
|
+
│ ├── test_benchmark.py
|
|
514
|
+
│ ├── test_imputation_workflow.py
|
|
515
|
+
│ ├── test_advanced_evaluation.py
|
|
516
|
+
│ └── test_session_report.py
|
|
517
|
+
├── validate_evaluation.py
|
|
518
|
+
├── simulation_validation_results.csv
|
|
519
|
+
├── simulation_validation_summary.csv
|
|
520
|
+
├── evaluation_validation_results.csv
|
|
521
|
+
├── evaluation_validation_summary.csv
|
|
522
|
+
├── pyproject.toml
|
|
523
|
+
├── README.md
|
|
524
|
+
├── CHANGELOG.md
|
|
525
|
+
└── LICENSE
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
## Limitations
|
|
529
|
+
|
|
530
|
+
- CSV input only; XLSX files are not currently supported.
|
|
531
|
+
- Input files require UTF-8-compatible encoding.
|
|
532
|
+
- Missingness uses pandas' default missing-value recognition.
|
|
533
|
+
- Very wide datasets may produce crowded visualizations.
|
|
534
|
+
- Large datasets may require substantial memory.
|
|
535
|
+
- Little's MCAR test focuses on numerical variables and cannot distinguish MAR from MNAR.
|
|
536
|
+
- Simulation requires complete observations.
|
|
537
|
+
- Repeated sampling may reuse observations when the requested simulation size exceeds the number of complete rows.
|
|
538
|
+
- Complete source observations may not represent the entire original population.
|
|
539
|
+
- Employment-based simulation requires an employment column.
|
|
540
|
+
- Random Forest performance depends on dataset characteristics and selected predictors.
|
|
541
|
+
- Analysis-Aware Evaluation currently focuses on numerical variables and simple linear regression.
|
|
542
|
+
- Mean and median imputation are basic handling methods and may distort distributions and relationships.
|
|
543
|
+
- Numerical imputation leaves categorical and Boolean columns unchanged; Mode handles categorical and Boolean columns separately. Entirely missing numerical columns cannot be filled.
|
|
544
|
+
- Benchmark MAE and RMSE are pooled in original units, so larger-scale variables may dominate.
|
|
545
|
+
- JSON session reports contain only the latest completed results, not a full experiment history or automatic session restoration.
|
|
546
|
+
- Manual GUI checks do not replace comprehensive automated GUI and concurrency testing.
|
|
547
|
+
- Regression R-squared measures in-sample fit, not performance on unseen observations.
|
|
548
|
+
- Regression outcome imputation is included for analytical distortion experiments, not as a general modeling recommendation.
|
|
549
|
+
- KS distance measures empirical distribution differences; it is not used as a hypothesis-test p-value.
|
|
550
|
+
- Analytical evaluation measures the combined effects of simulated missingness and missing-data handling.
|
|
551
|
+
- Synthetic validation does not establish universal reliability.
|
|
552
|
+
- Background-operation protection and responsiveness were manually checked with a 10,000-row synthetic dataset. Dedicated automated concurrency testing remains future work.
|
|
553
|
+
|
|
554
|
+
## Roadmap
|
|
555
|
+
|
|
556
|
+
### Completed
|
|
557
|
+
|
|
558
|
+
- Dataset import and exploratory missingness visualization.
|
|
559
|
+
- Little's MCAR test.
|
|
560
|
+
- Missingness pattern analysis.
|
|
561
|
+
- Feature 1: Learning and reproducing missingness patterns.
|
|
562
|
+
- Feature 2: Analysis-Aware Evaluation.
|
|
563
|
+
- Simulation comparison and evaluation CSV exports.
|
|
564
|
+
- KNN imputation.
|
|
565
|
+
- Iterative imputation.
|
|
566
|
+
- Categorical and Boolean mode imputation and categorical accuracy benchmarking.
|
|
567
|
+
- Imputation benchmarking using MAE and RMSE.
|
|
568
|
+
- Unit tests for imputation and benchmarking.
|
|
569
|
+
- GUI integration of all four numerical imputation methods and benchmarking.
|
|
570
|
+
- Advanced imputation methods in Analysis-Aware Evaluation.
|
|
571
|
+
- Cleaned dataset CSV export and JSON session reports.
|
|
572
|
+
- Coordinated pink GUI theme.
|
|
573
|
+
- Preliminary synthetic validation experiments.
|
|
574
|
+
|
|
575
|
+
### Future Work
|
|
576
|
+
|
|
577
|
+
- Feature 3: MNAR tipping-point and sensitivity analysis.
|
|
578
|
+
- Automated GUI and concurrency testing.
|
|
579
|
+
- Additional real-world case studies.
|
|
580
|
+
- Further distribution improvements.
|
|
581
|
+
- Final project paper and presentation.
|
|
582
|
+
|
|
583
|
+
## License
|
|
584
|
+
|
|
585
|
+
MIT. See `LICENSE`.
|
|
586
|
+
|
|
587
|
+
Authors: Ghina El Sabbagh and Clarita Daou (Lebanese American University). See [CITATION.cff](https://github.com/ghinasabbagh/MissingLab/blob/main/CITATION.cff) for citation metadata. Report issues through the [GitHub issue tracker](https://github.com/ghinasabbagh/MissingLab/issues).
|