Exemple #1
0
class LastFillImpute(BaseImputation):
    """
    LastFill imputation
    """
    def __init__(self):
        self.imputer = LastFill()

    def impute(self, input_df):
        assert self.imputer is not None
        df = self.imputer.impute(input_df)
        return df

    def restore(self, **config):
        self.imputer = LastFill()
Exemple #2
0
 def test_lastfill(self):
     last_fill = LastFill()
     mse_missing = last_fill.evaluate(self.data, 0.1)
     imputed_data = last_fill.impute(self.data)
     assert imputed_data.isna().sum().sum() == 0
     mse = last_fill.evaluate(imputed_data, 0.1)
Exemple #3
0
 def restore(self, **config):
     self.imputer = LastFill()
Exemple #4
0
 def __init__(self):
     self.imputer = LastFill()