Beispiel #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()
Beispiel #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)
Beispiel #3
0
 def restore(self, **config):
     self.imputer = LastFill()
Beispiel #4
0
 def __init__(self):
     self.imputer = LastFill()