(y, split_points=None, label_names=None)
return freq_dict
get frequency info of a given y set; only called when stratified is true
        :param y: list, y sample
        :param split_points: list, split points used to bin regression values
        :param label_names: list, label names of all data
        :return: dict
get frequency info of a given y set; only called when stratified is true
        :param y: list, y sample
        :param split_points: list, split points used to bin regression values
        :param label_names: list, label names of all data
        :return: dict
get frequency info of a given y set ; only called when stratified is true : param y : list y sample : param split_points : list split points used to bin regression values : param label_names : list label names of all data : return : dict
def get_class_freq(y, split_points=None, label_names=None):
        """
        get frequency info of a given y set; only called when stratified is true
        :param y: list, y sample
        :param split_points: list, split points used to bin regression values
        :param label_names: list, label names of all data
        :return: dict
        """
        freq_dict = collections.Counter(y)
        freq_keys = freq_dict.keys()
        # continuous label
        if split_points is not None:
            label_count = len(split_points) + 1
            # fill in count for missing bins
            if len(freq_keys) < label_count:
                for i in range(label_count):
                    if i not in freq_keys:
                        freq_dict[i] = 0
        # categorical label
        else:
            if label_names is None:
                raise ValueError("No label values collected.")
            label_count = len(label_names)
            # fill in count for missing labels
            if len(freq_keys) < label_count:
                for label in label_names:
                    if label not in freq_keys:
                        freq_dict[label] = 0
        return freq_dict
def get_class_freq ( y , split_points = None , label_names = None ) : freq_dict = collections . Counter ( y ) freq_keys = freq_dict . keys ( ) # continuous label if split_points is not None : label_count = len ( split_points ) + 1 # fill in count for missing bins if len ( freq_keys ) < label_count : for i in range ( label_count ) : if i not in freq_keys : freq_dict [ i ] = 0 # categorical label else : if label_names is None : raise ValueError ( "No label values collected." ) label_count = len ( label_names ) # fill in count for missing labels if len ( freq_keys ) < label_count : for label in label_names : if label not in freq_keys : freq_dict [ label ] = 0 return freq_dict