(self, X, y)
return super(RandomizedLasso, self).fit(X_rescaled, y)
Fit the model according to the given training data.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape = [n_samples, n_features]
            The training input samples.

        y : array-like, shape = [n_samples]
            The target values.
Fit the model according to the given training data.
Fit the model according to the given training data .
def fit(self, X, y):
        """Fit the model according to the given training data.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape = [n_samples, n_features]
            The training input samples.

        y : array-like, shape = [n_samples]
            The target values.
        """
        if not isinstance(self.weakness, float) or not (0.0 < self.weakness <= 1.0):
            raise ValueError('weakness should be a float in (0, 1], got %s' % self.weakness)

        X, y = check_X_y(X, y, accept_sparse=True)

        n_features = X.shape[1]
        weakness = 1. - self.weakness
        random_state = check_random_state(self.random_state)

        weights = weakness * random_state.randint(0, 1 + 1, size=(n_features,))

        # TODO: I am afraid this will do double normalization if set to true
        #X, y, _, _ = _preprocess_data(X, y, self.fit_intercept, normalize=self.normalize, copy=False,
        #             sample_weight=None, return_mean=False)

        # TODO: Check if this is a problem if it happens before standardization
        X_rescaled = _rescale_data(X, weights)
        return super(RandomizedLasso, self).fit(X_rescaled, y)
def fit ( self , X , y ) : if not isinstance ( self . weakness , float ) or not ( 0.0 < self . weakness <= 1.0 ) : raise ValueError ( 'weakness should be a float in (0, 1], got %s' % self . weakness ) X , y = check_X_y ( X , y , accept_sparse = True ) n_features = X . shape [ 1 ] weakness = 1. - self . weakness random_state = check_random_state ( self . random_state ) weights = weakness * random_state . randint ( 0 , 1 + 1 , size = ( n_features , ) ) # TODO: I am afraid this will do double normalization if set to true #X, y, _, _ = _preprocess_data(X, y, self.fit_intercept, normalize=self.normalize, copy=False, #             sample_weight=None, return_mean=False) # TODO: Check if this is a problem if it happens before standardization X_rescaled = _rescale_data ( X , weights ) return super ( RandomizedLasso , self ) . fit ( X_rescaled , y )