'Fit the LSH forest on the data.
This creates binary hashes of input data points by getting the
dot product of input points and hash_function then
transforming the projection into a binary string array based
on the sign (positive/negative) of the projection.
A sorted array of binary hashes is created.
Parameters
X : array_like or sparse (CSR) matrix, shape (n_samples, n_features)
List of n_features-dimensional data points. Each row
corresponds to a single data point.
Returns
self : object
Returns self.'

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

    self._fit_X = check_array(X, accept_sparse='csr')
    self.hash_functions_ = []
    self.trees_ = []
    self.original_indices_ = []
    rng = check_random_state(self.random_state)
    int_max = np.iinfo(np.int32).max
    for i in range(self.n_estimators):
        hasher = GaussianRandomProjectionHash(MAX_HASH_SIZE, rng.randint(0, int_max))
        hashes = hasher.fit_transform(self._fit_X)[:, 0]
        original_index = np.argsort(hashes)
        bin_hashes = hashes[original_index]
        self.original_indices_.append(original_index)
        self.trees_.append(bin_hashes)
        self.hash_functions_.append(hasher)
    self._generate_masks()
    return self
