(data_instances, label)
return data_instances
mask the instance.label to 1 if equals to label and 0 if not
mask the instance.label to 1 if equals to label and 0 if not
mask the instance . label to 1 if equals to label and 0 if not
def _mask_data_label(data_instances, label):
        """
        mask the instance.label to 1 if equals to label and 0 if not
        """

        def do_mask_label(instance):
            instance.label = (1 if (instance.label == label) else 0)
            return instance

        f = functools.partial(do_mask_label)
        data_instances = data_instances.mapValues(f)

        return data_instances
def _mask_data_label ( data_instances , label ) : def do_mask_label ( instance ) : instance . label = ( 1 if ( instance . label == label ) else 0 ) return instance f = functools . partial ( do_mask_label ) data_instances = data_instances . mapValues ( f ) return data_instances