def lower_bound_kim(X_train, X_test):
    """Compute the "LB_Kim" lower bounds between two datasets.

    Parameters
    ----------
    X_train : array-like, shape = (n_samples_train, n_timestamps)
        Training set.

    X_test: : array-like, shape = (n_samples_test, n_timestamps)
        Test set.

    Returns
    -------
    lower_bounds : array, shape = (n_samples_test, n_samples_train)
        "LB_Kim" lower bounds.

    References
    ----------
    .. [1] S. W. Kim et al, "An Index-Based Approach for Similarity Search
           Supporting Time Warping in Large Sequence Databases". International
           Conference on Data Engineering, 607-614 (2001).

    Examples
    --------
    >>> X_train = [[2, 1, 8, 4, 5], [1, 2, 3, 4, 5]]
    >>> X_test = [[5, 4, 3, 2, 1], [1, 8, 4, 3, 2], [6, 3, 5, 4, 7]]
    >>> lower_bound_kim(X_train, X_test)
    array([[4, 4],
           [3, 3],
           [4, 5]])

    """
    X_train = check_array(X_train)
    X_test = check_array(X_test)
    _check_consistent_lengths(X_train, X_test)
    first = np.abs(X_test[:, 0, None] - X_train[None, :, 0])
    last = np.abs(X_test[:, -1, None] - X_train[None, :, -1])
    max_ = np.abs(np.max(X_test, axis=1)[:, None]
                  - np.max(X_train, axis=1)[None, :])
    min_ = np.abs(np.min(X_test, axis=1)[:, None]
                  - np.min(X_train, axis=1)[None, :])
    lb_kim = np.max(np.asarray([first, last, max_, min_]), axis=0)
    return lb_kim
Compute the "LB_Kim" lower bounds between two datasets.

    Parameters
    ----------
    X_train : array-like, shape = (n_samples_train, n_timestamps)
        Training set.

    X_test: : array-like, shape = (n_samples_test, n_timestamps)
        Test set.

    Returns
    -------
    lower_bounds : array, shape = (n_samples_test, n_samples_train)
        "LB_Kim" lower bounds.

    References
    ----------
    .. [1] S. W. Kim et al, "An Index-Based Approach for Similarity Search
           Supporting Time Warping in Large Sequence Databases". International
           Conference on Data Engineering, 607-614 (2001).

    Examples
    --------
    >>> X_train = [[2, 1, 8, 4, 5], [1, 2, 3, 4, 5]]
    >>> X_test = [[5, 4, 3, 2, 1], [1, 8, 4, 3, 2], [6, 3, 5, 4, 7]]
    >>> lower_bound_kim(X_train, X_test)
    array([[4, 4],
           [3, 3],
           [4, 5]])

    
pyts/metrics/lower_bounds.py