'Fit the model with X.
Samples random projection according to n_features.
Parameters
X : array-like, shape (n_samples, n_features)
Training data, where n_samples in the number of samples
and n_features is the number of features.
Returns
self : object
Returns the transformer.'

def fit(self, X, y=None):

    X = check_array(X)
    random_state = check_random_state(self.random_state)
    n_features = X.shape[1]
    uniform = random_state.uniform(size=(n_features, self.n_components))
    self.random_weights_ = ((1.0 / np.pi) * np.log(np.tan(((np.pi / 2.0) * uniform))))
    self.random_offset_ = random_state.uniform(0, (2 * np.pi), size=self.n_components)
    return self
