(data_inst)
return num_class, list(class_set)
Label Checker in classification task.
            Check whether the distinct labels is no more than MAX_CLASSNUM which define in consts,
            also get all distinct labels

        Parameters
        ----------
        data_inst : Table,
                    values are data instance format define in federatedml/feature/instance.py

        Returns
        -------
        num_class : int, the number of distinct labels

        labels : list, the distince labels
Label Checker in classification task.
            Check whether the distinct labels is no more than MAX_CLASSNUM which define in consts,
            also get all distinct labels
Label Checker in classification task . Check whether the distinct labels is no more than MAX_CLASSNUM which define in consts also get all distinct labels
def validate_label(data_inst):
        """
        Label Checker in classification task.
            Check whether the distinct labels is no more than MAX_CLASSNUM which define in consts,
            also get all distinct labels

        Parameters
        ----------
        data_inst : Table,
                    values are data instance format define in federatedml/feature/instance.py

        Returns
        -------
        num_class : int, the number of distinct labels

        labels : list, the distince labels

        """
        class_set = data_inst.applyPartitions(ClassifyLabelChecker.get_all_class).reduce(lambda x, y: x | y)

        num_class = len(class_set)
        if len(class_set) > consts.MAX_CLASSNUM:
            raise ValueError("In Classfy Proble, max dif classes should no more than %d" % (consts.MAX_CLASSNUM))

        return num_class, list(class_set)
def validate_label ( data_inst ) : class_set = data_inst . applyPartitions ( ClassifyLabelChecker . get_all_class ) . reduce ( lambda x , y : x | y ) num_class = len ( class_set ) if len ( class_set ) > consts . MAX_CLASSNUM : raise ValueError ( "In Classfy Proble, max dif classes should no more than %d" % ( consts . MAX_CLASSNUM ) ) return num_class , list ( class_set )