def gen_xy(data, h_test):
    """
    Generate the data matrices for regression (X and y).

    Args:
        data (pd.DataFrame): complete table with wealth/premiums/claims

        h_test (int): h = h_test? interest in 1
        (saved in **values_in_interest.json**)

    Returns:
        ydata (dict): premiums/claims data

        xdata (np.ndarray): 2d array of size ((wealth, loadings, h), years)

    """
    data['loadings'] = (data['Premiums'] / data['Claims']) - 1
    data['h'] = h_test

    xdata = data[['Wealth', 'loadings', 'h']].values.T
    ydata = data[['Premiums', 'Claims']].to_dict('list')

    return ydata, xdata