(table, impute=True)
return new_data
Remove categorical attributes and impute missing values.
Remove categorical attributes and impute missing values.
Remove categorical attributes and impute missing values .
def _preprocess(table, impute=True):
    """Remove categorical attributes and impute missing values."""
    if not len(table):  # this can be an array, pylint: disable=len-as-condition
        return table
    new_domain = Domain(
        [a for a in table.domain.attributes if a.is_continuous],
        table.domain.class_vars,
        table.domain.metas)
    new_data = table.transform(new_domain)
    if impute:
        new_data = SklImpute()(new_data)
    return new_data
def _preprocess ( table , impute = True ) : if not len ( table ) : # this can be an array, pylint: disable=len-as-condition return table new_domain = Domain ( [ a for a in table . domain . attributes if a . is_continuous ] , table . domain . class_vars , table . domain . metas ) new_data = table . transform ( new_domain ) if impute : new_data = SklImpute ( ) ( new_data ) return new_data