def split_data(x, y, test_data_ratio):
    """Split one dataset which consists of
    descriptive features and target features into 2 datasets,
    that is training data and test data.

    The number of x's row must be the same as the one of y's row.

    Arguments
    ---------
    x : np.array
        Descriptive features in 2d array
        whose shape is (num of data, num of feature).
    y : np.array
        Target features in 2d array
        whose shape is (num of data, num of feature).
    test_data_ratio : float
        Desired ratio of test data in range from 0.0 to 1.0.
        If 0.3, 30% data is for test data and
        rest of the data is for training data.

    Returns
    -------
    np.array, np.array, np.array, np.array
        The former 2 arrays are descriptive features
        and target features of training data.
        The latter 2 arrays are descriptive features
        and target features of test data.
    """
    training_data_num = x.shape[0]

    if (test_data_ratio > 0.) and (test_data_ratio < 1.):
        training_data_num = int(training_data_num * (1. - test_data_ratio))

    x_train = x[:training_data_num, :]
    y_train = y[:training_data_num, :]
    x_test = x[training_data_num:, :]
    y_test = y[training_data_num:, :]

    return x_train, y_train, x_test, y_test