cumulative_logistic.py 文件源码

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

项目:diamond 作者: stitchfix 项目源码 文件源码
def _create_response_matrix(self):
        LOGGER.info("Creating response matrix.")
        df = pd.DataFrame({
            'index': self.train_df.index,
            'y': self.train_df[self.response]})
        Y = pd.pivot_table(df,
                           index='index',
                           columns=['y'],
                           aggfunc=len,
                           fill_value=0).as_matrix()
        self.response = Y
        self.J = self.response.shape[1]
        LOGGER.info("Created response matrix with shape (%d, %d)",
                    self.response.shape[0], self.response.shape[1])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号