'Random Split Sampling the dataset into two sets.
Parameters
evaluation_fraction : float (default None)
Should be between 0.0 and 1.0 and represent the proportion of
the dataset to include in the training set. If evaluation_fraction
is None, it will be used the one passed in the constructor.
indices : boolean, optional (default False)
Return  split with integer indices or boolean mask.
Integer indices are useful when dealing with sparse matrices
that cannot be indexed by boolean masks.
random_state : int or RandomState
Pseudo-random number generator state used for random sampling.
permutation: boolean, optional (default True)
For testing purposes, to deactivate the permutation.'

def split(self, evaluation_fraction=None, indices=False, random_state=None, permutation=True):

    if (evaluation_fraction is not None):
        self.evaluation_fraction = evaluation_fraction
    if (random_state is not None):
        self.random_state = random_state
    self.indices = indices
    rng = self.random_state = check_random_state(self.random_state)
    n_train = ceil((self.evaluation_fraction * self.n))
    permutation = (rng.permutation(self.n) if permutation else np.arange(self.n))
    ind_train = permutation[(- n_train):]
    ind_ignore = permutation[:(- n_train)]
    if self.indices:
        return (ind_train, ind_ignore)
    else:
        train_mask = np.zeros(self.n, dtype=np.bool)
        train_mask[ind_train] = True
        test_mask = np.zeros(self.n, dtype=np.bool)
        test_mask[ind_ignore] = True
        return (train_mask, test_mask)
