def test_actual_results_random_indices(params):
    """Test the actual results with random indices."""
    fe = WindowFeatureExtractor(**params).fit(X_ones)

    n_windows = fe.get_params()['n_windows']
    if isinstance(n_windows, (float, np.floating)):
        n_windows = int(np.ceil(n_windows * n_timestamps))

    min_window_size = fe.get_params()['min_window_size']
    if isinstance(min_window_size, (float, np.floating)):
        min_window_size = int(np.ceil(min_window_size * n_timestamps))

    # With an array full of ones
    arr_actual = fe.transform(X_ones)
    arr_desired = np.tile(
        np.c_[np.ones(n_samples), np.zeros((n_samples, 2))], n_windows
    )
    np.testing.assert_allclose(arr_actual, arr_desired, atol=1e-5, rtol=0)

    # With an array arange-like, test the slope
    arr_actual = fe.transform(X_arange)
    if min_window_size > 1:
        np.testing.assert_allclose(arr_actual[:, 2::3], 1, atol=1e-5, rtol=0)
    else:
        assert np.all(np.isin(arr_actual[:, 2::3], [0, 1]))
Test the actual results with random indices.
pyts/classification/tests/test_time_series_forest.py