MCPcopy Create free account
hub / github.com/dmlc/xgboost / mixture_2comp

Function mixture_2comp

python-package/xgboost/testing/data.py:262–269  ·  view source on GitHub ↗
(
        means: List[float], sigmas: List[float], weights: List[float]
    )

Source from the content-addressed store, hash-verified

260 pd = pytest.importorskip("pandas")
261
262 def mixture_2comp(
263 means: List[float], sigmas: List[float], weights: List[float]
264 ) -> np.ndarray:
265 l0 = rng.normal(
266 size=(int(n_samples * weights[0])), loc=means[0], scale=sigmas[0]
267 )
268 l1 = rng.normal(size=(n_samples - l0.shape[0]), loc=means[1], scale=sigmas[1])
269 return np.concatenate([l0, l1], axis=0)
270
271 def norm(mean: float, std: float) -> np.ndarray:
272 return rng.normal(loc=mean, scale=std, size=(n_samples,))

Callers 1

get_california_housingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected