@@ -106,11 +106,13 @@ class SqrtLasso(LinearModel, RegressorMixin):
106106 """
107107
108108 def __init__ (self , alpha = 1. , max_iter = 100 , max_pn_iter = 100 , p0 = 10 ,
109- << << << < HEAD
109+ << << << < HEAD
110110 tol = 1e-4 , verbose = 0 , fit_intercept = True ):
111- == == == =
112- tol = 1e-4 , verbose = 0 , fit_intercept = False ):
113- >> >> >> > 69 bf74f (first try , add support for fit_intercept in sqrtLasso , TODOS : review if correct , clean up , pot . add support for sparse X (not sure if that works ), enhance docstring )
111+
112+
113+ == == == =
114+ tol = 1e-4 , verbose = 0 , fit_intercept = False ):
115+ >> >> >> > 69 bf74f (first try , add support for fit_intercept in sqrtLasso , TODOS : review if correct , clean up , pot . add support for sparse X (not sure if that works ), enhance docstring )
114116 super ().__init__ ()
115117 self .alpha = alpha
116118 self .max_iter = max_iter
@@ -138,11 +140,6 @@ def fit(self, X, y):
138140 self :
139141 Fitted estimator.
140142 """
141- << << < << HEAD
142- self .coef_ = self .path (X , y , alphas = [self .alpha ])[1 ][0 ]
143- if self .fit_intercept :
144- self .intercept_ = self .coef_ [- 1 ]
145- == == == =
146143 # self.coef_ = self.path(X, y, alphas=[self.alpha])[1][0]
147144 if self .fit_intercept :
148145 X_mean = X .mean (axis = 0 )
@@ -157,7 +154,6 @@ def fit(self, X, y):
157154
158155 if self .fit_intercept :
159156 self .intercept_ = y_mean - X_mean @ self .coef_
160- >> >> >> > 69 bf74f (first try , add support for fit_intercept in sqrtLasso , TODOS : review if correct , clean up , pot . add support for sparse X (not sure if that works ), enhance docstring )
161157 else :
162158 self .intercept_ = 0.
163159 return self
0 commit comments