KA_data_exploration.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Kaggle_Buddy 作者: NickYi1990 项目源码 文件源码
def ka_C_Binary_ratio(y, positive=1):
    '''Find the positive ration of dependent variable

        Parameters
        ----------
        y: pandas series
           binary dependent variable
        positive: 1 or 0
                  identify which value is positive

        Return
        ------
        float value display positive rate
    '''
    return y.value_counts()[positive] / (y.value_counts().sum())

####################################################################################
##                              NUMERICAL BLOCK
####################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号