def train_test_split(df, test_size, random_state):
    """The sample set is divided into training set and Validation set

    Parameters
    ----------
    df : spark DataFrame
        Sample set to be splited.

    test_size : float
        The value should be between 0.0 and 1.0 and represent the proportion
        of the dataset to include in the test split.

    random_state : int
        Controls the shuffling applied to the data before applying the split.


    Returns
    --------
    train_df : DataFrame
        Training sample set

    test_df : DataFrame
        Testing sample set


    Examples
    ----------
    >>> df.mega.head(5)
      PassengerId Survived Pclass  ...     Fare Cabin Embarked
    0           1        0      3  ...     7.25  None        S
    1           2        1      1  ...  71.2833   C85        C
    2           3        1      3  ...    7.925  None        S
    3           4        1      1  ...     53.1  C123        S
    4           5        0      3  ...     8.05  None        S
    >>> trainDF, testDF = tm.train_test_split(df, test_size=0.3, random_state=99)
    >>> trainDF.mega.head(5)
          PassengerId Survived Pclass  ...     Fare Cabin Embarked
    0           1        0      3  ...     7.25  None        S
    1          10        1      2  ...  30.0708  None        C
    2         100        0      2  ...       26  None        S
    3         103        0      1  ...  77.2875   D26        S
    4         104        0      3  ...   8.6542  None        S
    """
    train_size = 1 - test_size
    train_df, test_df = df.randomSplit(
        [train_size, test_size], seed=random_state)
    return train_df, test_df