(name, estimator_orig)
| 1954 | |
| 1955 | |
| 1956 | def check_complex_data(name, estimator_orig): |
| 1957 | rng = np.random.RandomState(42) |
| 1958 | # check that estimators raise an exception on providing complex data |
| 1959 | X = rng.uniform(size=10) + 1j * rng.uniform(size=10) |
| 1960 | X = X.reshape(-1, 1) |
| 1961 | |
| 1962 | # Something both valid for classification and regression |
| 1963 | y = rng.randint(low=0, high=2, size=10) + 1j |
| 1964 | estimator = clone(estimator_orig) |
| 1965 | set_random_state(estimator, random_state=0) |
| 1966 | with raises(ValueError, match="Complex data not supported"): |
| 1967 | estimator.fit(X, y) |
| 1968 | |
| 1969 | |
| 1970 | @ignore_warnings |
nothing calls this directly
no test coverage detected
searching dependent graphs…