models.py 文件源码

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

项目:AutoML5 作者: djajetic 项目源码 文件源码
def predict_proba(self, X):
        if len(X.shape)==1: # IG modif Feb3 2015
            X = np.reshape(X,(-1,1))   
        prediction = self.predictors[0].predict_proba(X)
        if self.n_label==2:                 # Keep only 1 prediction, 1st column = (1 - 2nd column)
            prediction = prediction[:,1]
        for i in range(1,self.n_target): # More than 1 target, we assume that labels are binary
            new_prediction = self.predictors[i].predict_proba(X)[:,1]
            prediction = np.column_stack((prediction, new_prediction))
        return prediction
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号