SklearnOutlierDetector.py 文件源码

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

项目:pyISC 作者: STREAM3 项目源码 文件源码
def fit(self, X, y=None):
        old_threshold = None
        threshold = None
        self.threshold_ = 0.0

        self._fit(X,y)

        count = 0
        while count < 100 and (old_threshold is None or abs(threshold - old_threshold) > 0.01):
            old_threshold = threshold
            ss = self.decision_function(X,y)
            threshold = percentile(ss, 100 * self.contamination)

            self._fit(X[ss > threshold],y[ss > threshold] if y is not None else None)

            count += 1

        self.threshold_ = threshold

        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号