double.py 文件源码

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

项目:l1l2py 作者: slipguru 项目源码 文件源码
def fit(self, X, y):
        X = np.asanyarray(X)
        y = np.asanyarray(y)

        # Selection        
        self.selector.fit(X, y)
        self.selected_ = (np.abs(self.selector.coef_) >= self.threshold)

        # Final Estimation
        self.estimator.fit(X[:, self.selected_], y)

        # Coefficients
        self.coef_ = np.zeros_like(self.selector.coef_)
        self.coef_[self.selected_] = self.estimator.coef_
        self.intercept_ = self.estimator.intercept_

        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号