parametric.py 文件源码

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

项目:kenchi 作者: Y-oHr-N 项目源码 文件源码
def fit(self, X, y=None):
        """Fit the model according to the given training data.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Samples.

        Returns
        -------
        self : detector
            Return self.
        """

        X                   = check_array(X)

        self._gmm           = GaussianMixture(
            covariance_type = self.covariance_type,
            max_iter        = self.max_iter,
            means_init      = self.means_init,
            n_components    = self.n_components,
            precisions_init = self.precisions_init,
            random_state    = self.random_state,
            tol             = self.tol,
            warm_start      = self.warm_start,
            weights_init    = self.weights_init
        ).fit(X)

        self.y_score_       = self.anomaly_score(X)
        self.threshold_     = np.percentile(
            self.y_score_, 100.0 * (1.0 - self.fpr)
        )

        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号