def METHOD_NAME():
    """Test regression with overlap correction."""
    pytest.importorskip("sklearn")
    signal = np.zeros(100000)
    times = [1000, 2500, 3000, 5000, 5250, 7000, 7250, 8000]
    events = np.zeros((len(times), 3), int)
    events[:, 2] = 1
    events[:, 0] = times
    signal[events[:, 0]] = 1.0
    effect = hann(101)
    signal = np.convolve(signal, effect)[: len(signal)]
    raw = RawArray(signal[np.newaxis, :], mne.create_info(1, 100, "eeg"))
    assert_allclose(
        effect, linear_regression_raw(raw, events, {1: 1}, tmin=0)[1].data.flatten()
    )
    # test that sklearn solvers can be used
    from sklearn.linear_model import ridge_regression
    def solver(X, y):
        return ridge_regression(X, y, alpha=0.0, solver="cholesky")
    assert_allclose(
        effect,
        linear_regression_raw(raw, events, tmin=0, solver=solver)["1"].data.flatten(),
    )
    # test bad solvers
    def solT(X, y):
        return ridge_regression(X, y, alpha=0.0, solver="cholesky").T
    pytest.raises(ValueError, linear_regression_raw, raw, events, solver=solT)
    pytest.raises(ValueError, linear_regression_raw, raw, events, solver="err")
    pytest.raises(TypeError, linear_regression_raw, raw, events, solver=0)