awslabs / datawig

Imputation of missing values in tables.
Apache License 2.0
478 stars 69 forks source link

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'SDNN\\imputer.log' #127

Closed malkhodari closed 4 years ago

malkhodari commented 4 years ago

Hello,

Thank you for this code.

I am currently using Datawig for data imputation of numerical dataset.

However, an error is received when calling the Simpleimputer.complete function:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'SDNN\imputer.log'

SDNN is my column name in array.

This is my code:

import scipy.io

mat = scipy.io.loadmat('A_only_HRV.mat') training_array_A = mat['A_only_HRV'] mat = scipy.io.loadmat('dataset_all_A_fixed_missing.mat') test_array_A = mat['dataset_all_A_fixed_missing']

import pandas as pd c = pd.DataFrame(data=test_array_A,columns=['AVNN','SDNN','RMSSD','pNN','SEM','BETA','HF_NORM','HF_Peak','HF_Power','LF_Norm','LF_Peak','LF_Power','LF/HF','Total_Power','VLF_Norm','VLF_Power','SD1','SD2','Alpha1','Alpha2','SE','PIP','IALS','PSS','PAS']) c2 = c.astype('str')

c_train = pd.DataFrame(data=training_array_A,columns=['AVNN','SDNN','RMSSD','pNN','SEM','BETA','HF_NORM','HF_Peak','HF_Power','LF_Norm','LF_Peak','LF_Power','LF/HF','Total_Power','VLF_Norm','VLF_Power','SD1','SD2','Alpha1','Alpha2','SE','PIP','IALS','PSS','PAS']) c_train2 = c_train.astype('str')

import datawig, numpy from datawig import SimpleImputer

df_with_missing_imputed = datawig.SimpleImputer.complete(c)

I am attaching the needed files, I obtain them as .mat files.

files.zip

Could you please let me know why am facing this error?

felixbiessmann commented 4 years ago

Thanks for raising this issue. I'm not sure but it could be addressed in a recent pull request, which we'll release asap: https://github.com/awslabs/datawig/pull/126

malkhodari commented 4 years ago

So the code is written correctly? It is not the input data that is causing the problem? It is something with Datawig?

malkhodari commented 4 years ago

It can be fixed if I update the imputer.py file with the new code in #126 right?

tdhd commented 4 years ago

We have merged a fix in https://github.com/awslabs/datawig/pull/131, closing the issue.

Feel free to reopen in case the problems persists.