Skip to content

Imputations run on the reference of the value #20

@eltonlaw

Description

@eltonlaw
>>> random_normal(shape=(100, 100))
array([[        nan,         nan,         nan, ...,  2.29665783,            
                nan, -0.71412759],    
       [ 0.49046767, -0.31572648,         nan, ...,  1.39596078,            
        -1.14295358, -1.30660838],    
       [        nan, -2.0708818 ,  0.7393569 , ..., -0.52974738,            
         0.24717896, -2.37030327],    
       ...,        
       [ 0.01155974,  0.88793848, -0.04410631, ..., -1.28196955,            
         0.75566477, -0.39039914],    
       [ 0.23240304,         nan,  1.59899984, ..., -1.06248365,            
                nan,  0.65453688],    
       [-0.13855768, -0.00358682,         nan, ...,  1.29588659,            
        -0.20579175,  0.59610582]])   
>>> data = random_normal(shape=(100, 100))                                  
>>> import impyute as impy            
>>> impy.em(data)  
array([[ 0.5599156 , -0.24410474, -0.99875721, ..., -0.74595691,            
         0.25954462,  0.3936289 ],    
       [-0.5491675 ,  0.39810825,  0.15029102, ..., -0.99765863,            
        -0.98604735,  1.24321062],    
       [ 0.36389712,  1.56754062,  1.38492368, ..., -0.04457599,            
        -0.12098783,  0.98864098],    
       ...,        
       [ 1.37199931, -0.45710982, -1.30196092, ..., -0.38020366,            
         0.31780175, -0.08301059],    
       [ 0.52415   , -1.02749075,  2.03909177, ...,  0.66138282,            
         1.31679312, -0.41575647],    
       [-0.36272847,  0.65262579, -0.11336795, ..., -0.1538307 ,            
        -1.24756562, -0.27470951]])   
>>> impy.em(data)  
Traceback (most recent call last):    
  File "<stdin>", line 1, in <module> 
  File "/Users/elton.law/sandbox/github/impyute/impyute/utils/checks.py", line 34, in wrapper
    raise BadInputError("No NaN's in given data")                           
impyute.utils.errors.BadInputError: No NaN's in given data                  
>>> 

Need to make a copy and run each algorithm on that instead. This can be very expensive for big datasets. Keep an inplace keyword like in pandas so that we can use both behaviours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions