custom_classifiers.py 文件源码

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

项目:emnlp2016 作者: stephenroller 项目源码 文件源码
def fit(self, X, y):
        feature = X[:,0]
        p, r, t = precision_recall_curve(y, feature)
        #nonzero = (p > 0) & (r > 0)
        #p, r, t = p[nonzero], r[nonzero], t[nonzero[1:]]
        f1 = np.divide(2 * np.multiply(p, r), p + r)
        f1[np.isnan(f1)] = -1.0
        self.threshold_ = t[f1.argmax()]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号