def test_actual_results_quantile_transformer_normal():
    """Test that the actual results are the expected ones."""
    X_ppf = norm.ppf(np.linspace(0, 1, 1000)[1:-1])
    weights = np.round(norm.pdf(X_ppf) * 1000).astype('int64')
    X = []
    for value, weight in zip(X_ppf, weights):
        X += [value] * weight
    X = np.asarray(X).reshape(1, -1)
    transformer = QuantileTransformer(n_quantiles=11,
                                      output_distribution='normal')
    arr_actual = transformer.fit_transform(X)
    arr_desired = X
    atol = 0.01 * X.shape[1]
    np.testing.assert_allclose(arr_actual, arr_desired, atol=atol, rtol=0.)
Test that the actual results are the expected ones.
pyts/preprocessing/tests/test_transformer.py