File manager - Edit - /usr/local/lib/python3.9/dist-packages/sklearn/utils/tests/test_weight_vector.py
Back
import numpy as np import pytest from sklearn.utils._weight_vector import ( WeightVector32, WeightVector64, ) @pytest.mark.parametrize( "dtype, WeightVector", [ (np.float32, WeightVector32), (np.float64, WeightVector64), ], ) def test_type_invariance(dtype, WeightVector): """Check the `dtype` consistency of `WeightVector`.""" weights = np.random.rand(100).astype(dtype) average_weights = np.random.rand(100).astype(dtype) weight_vector = WeightVector(weights, average_weights) assert np.asarray(weight_vector.w).dtype is np.dtype(dtype) assert np.asarray(weight_vector.aw).dtype is np.dtype(dtype)
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.39 |
proxy
|
phpinfo
|
Settings