def test_euclidean_distances():
    X = da.random.uniform(size=(100, 4), chunks=50)
    Y = da.random.uniform(size=(100, 4), chunks=50)
    a = dask_ml.metrics.euclidean_distances(X, Y)
    b = sklearn.metrics.euclidean_distances(X, Y)
    assert_eq(a, b)
    x_norm_squared = (X ** 2).sum(axis=1).compute()[:, np.newaxis]
    a = dask_ml.metrics.euclidean_distances(X, Y, X_norm_squared=x_norm_squared)
    b = sklearn.metrics.euclidean_distances(X, Y, X_norm_squared=x_norm_squared)
    assert_eq(a, b)
    y_norm_squared = (Y ** 2).sum(axis=1).compute()[np.newaxis, :]
    a = dask_ml.metrics.euclidean_distances(X, Y, Y_norm_squared=y_norm_squared)
    b = sklearn.metrics.euclidean_distances(X, Y, Y_norm_squared=y_norm_squared)
    assert_eq(a, b)
def test_euclidean_distances():
    X = da.random.uniform(size=(100, 4), chunks=50)
    Y = da.random.uniform(size=(100, 4), chunks=50)
    a = dask_ml.metrics.euclidean_distances(X, Y)
    b = sklearn.metrics.euclidean_distances(X, Y)
    assert_eq(a, b)
    x_norm_squared = (X ** 2).sum(axis=1).compute()[:, np.newaxis]
    a = dask_ml.metrics.euclidean_distances(X, Y, X_norm_squared=x_norm_squared)
    b = sklearn.metrics.euclidean_distances(X, Y, X_norm_squared=x_norm_squared)
    assert_eq(a, b)
    y_norm_squared = (Y ** 2).sum(axis=1).compute()[np.newaxis, :]
    a = dask_ml.metrics.euclidean_distances(X, Y, Y_norm_squared=y_norm_squared)
    b = sklearn.metrics.euclidean_distances(X, Y, Y_norm_squared=y_norm_squared)
    assert_eq(a, b)