(self, train_scores, validate_scores, train_labels, validate_labels, debug=False)
Compute the PSI index
        Parameters
        ----------
        train_scores: The predict results of train data
        validate_scores: The predict results of validate data
        train_labels: labels of train set
        validate_labels: labels of validate set
        debug: print additional info
Compute the PSI index
        Parameters
        ----------
        train_scores: The predict results of train data
        validate_scores: The predict results of validate data
        train_labels: labels of train set
        validate_labels: labels of validate set
        debug: print additional info
Compute the PSI index Parameters ---------- train_scores : The predict results of train data validate_scores : The predict results of validate data train_labels : labels of train set validate_labels : labels of validate set debug : print additional info
def psi(self, train_scores, validate_scores, train_labels, validate_labels, debug=False):
        """
        Compute the PSI index
        Parameters
        ----------
        train_scores: The predict results of train data
        validate_scores: The predict results of validate data
        train_labels: labels of train set
        validate_labels: labels of validate set
        debug: print additional info
        """
        if self.eval_type == consts.BINARY:
            psi_computer = classification_metric.PSI()
            psi_scores, total_psi, expected_interval, expected_percentage, actual_interval, actual_percentage, \
            train_pos_perc, validate_pos_perc, intervals = psi_computer.compute(train_scores, validate_scores,
                                                                                  debug=debug, str_intervals=True,
                                                                                  round_num=6, train_labels=train_labels
                                                                                  ,validate_labels=validate_labels)

            len_list = np.array([len(psi_scores), len(expected_interval), len(expected_percentage), len(actual_interval)
                                 , len(actual_percentage), len(intervals)])

            assert (len_list == len(psi_scores)).all()

            return list(psi_scores), total_psi, self.__to_int_list(expected_interval), list(expected_percentage), \
                   self.__to_int_list(actual_interval), list(actual_percentage), list(train_pos_perc), \
                   list(validate_pos_perc), intervals

        else:
            logging.warning('error: psi metric is for binary classification only')
def psi ( self , train_scores , validate_scores , train_labels , validate_labels , debug = False ) : if self . eval_type == consts . BINARY : psi_computer = classification_metric . PSI ( ) psi_scores , total_psi , expected_interval , expected_percentage , actual_interval , actual_percentage , train_pos_perc , validate_pos_perc , intervals = psi_computer . compute ( train_scores , validate_scores , debug = debug , str_intervals = True , round_num = 6 , train_labels = train_labels , validate_labels = validate_labels ) len_list = np . array ( [ len ( psi_scores ) , len ( expected_interval ) , len ( expected_percentage ) , len ( actual_interval ) , len ( actual_percentage ) , len ( intervals ) ] ) assert ( len_list == len ( psi_scores ) ) . all ( ) return list ( psi_scores ) , total_psi , self . __to_int_list ( expected_interval ) , list ( expected_percentage ) , self . __to_int_list ( actual_interval ) , list ( actual_percentage ) , list ( train_pos_perc ) , list ( validate_pos_perc ) , intervals else : logging . warning ( 'error: psi metric is for binary classification only' )