MCPcopy
hub / github.com/scikit-learn/scikit-learn / check_complex_data

Function check_complex_data

sklearn/utils/estimator_checks.py:1956–1967  ·  view source on GitHub ↗
(name, estimator_orig)

Source from the content-addressed store, hash-verified

1954
1955
1956def 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

Callers

nothing calls this directly

Calls 4

cloneFunction · 0.90
set_random_stateFunction · 0.90
raisesFunction · 0.90
fitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…