(self, pick_high=True, selection_properties=None, feature_values=None)
Make sure at least one feature can be left after filtering.

        Parameters
        ----------
        pick_high: bool
            Set when none of value left, choose the highest one or lowest one. True means highest one while
            False means lowest one.
Make sure at least one feature can be left after filtering.
Make sure at least one feature can be left after filtering .
def _keep_one_feature(self, pick_high=True, selection_properties=None, feature_values=None):
        """
        Make sure at least one feature can be left after filtering.

        Parameters
        ----------
        pick_high: bool
            Set when none of value left, choose the highest one or lowest one. True means highest one while
            False means lowest one.
        """

        if selection_properties is None:
            selection_properties = self.selection_properties

        if feature_values is None:
            feature_values = self.feature_values

        if len(selection_properties.left_col_indexes) > 0:
            return

        LOGGER.info("All features has been filtered, keep one without satisfying all the conditions")

        # LOGGER.debug("feature values: {}, select_col_names: {}, left_col_names: {}".format(
        #     self.feature_values, self.selection_properties.select_col_names, self.selection_properties.left_col_names
        # ))

        # random pick one
        if len(feature_values) == 0:
            left_col_name = random.choice(selection_properties.select_col_names)
        else:
            result = sorted(feature_values.items(), key=operator.itemgetter(1), reverse=pick_high)
            left_col_name = result[0][0]
        # LOGGER.debug("feature values: {}, left_col_name: {}".format(self.feature_values, left_col_name))

        selection_properties.add_left_col_name(left_col_name)
def _keep_one_feature ( self , pick_high = True , selection_properties = None , feature_values = None ) : if selection_properties is None : selection_properties = self . selection_properties if feature_values is None : feature_values = self . feature_values if len ( selection_properties . left_col_indexes ) > 0 : return LOGGER . info ( "All features has been filtered, keep one without satisfying all the conditions" ) # LOGGER.debug("feature values: {}, select_col_names: {}, left_col_names: {}".format( #     self.feature_values, self.selection_properties.select_col_names, self.selection_properties.left_col_names # )) # random pick one if len ( feature_values ) == 0 : left_col_name = random . choice ( selection_properties . select_col_names ) else : result = sorted ( feature_values . items ( ) , key = operator . itemgetter ( 1 ) , reverse = pick_high ) left_col_name = result [ 0 ] [ 0 ] # LOGGER.debug("feature values: {}, left_col_name: {}".format(self.feature_values, left_col_name)) selection_properties . add_left_col_name ( left_col_name )