Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (12 sloc) 513 Bytes
"""Returns 1 if a value is missing, or 0 otherwise"""
from h2oaicore.transformer_utils import CustomTransformer
import datatable as dt
import numpy as np
class FlagMissingTransformer(CustomTransformer):
@staticmethod
def get_default_properties():
return dict(col_type="all", min_cols=1, max_cols=1, relative_importance=1)
def fit_transform(self, X: dt.Frame, y: np.array = None):
return self.transform(X)
def transform(self, X: dt.Frame):
return X[:, dt.isna(dt.f[0])]
You can’t perform that action at this time.