示例#1
0
文件: utils.py 项目: jdnc/ml-project
    def __init__(self, penalty='l1', dual=None, C=None, alpha=None):

        self.l1 = True if penalty=="l1" else False
        if self.l1:
            Lasso.__init__(self, alpha=alpha)
        else:
            Ridge.__init__(self, alpha=alpha)
示例#2
0
 def __init__(self, X, y, lmbd, rank_tol=None):
     Regression.__init__(self,
                         X,
                         y,
                         lmbd=lmbd,
                         solve_method=None,
                         rank_tol=rank_tol)
     Lasso.__init__(self, alpha=lmbd, fit_intercept=False)
     self.fit(X, y)
示例#3
0
 def __init__(self,
              alpha=1.0,
              fit_intercept=True,
              normalize=False,
              precompute=False,
              copy_X=True,
              max_iter=1000,
              tol=1e-4,
              warm_start=False,
              positive=False,
              random_state=None,
              selection='cyclic'):
     _LassoReg.__init__(self, alpha, fit_intercept, normalize, precompute,
                        copy_X, max_iter, tol, warm_start, positive,
                        random_state, selection)
     BaseWrapperReg.__init__(self)