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

Function gen_circle

demo/guide-python/multioutput_regression.py:39–47  ·  view source on GitHub ↗

Generate a sample dataset that y is a 2 dim circle.

()

Source from the content-addressed store, hash-verified

37
38
39def gen_circle() -> Tuple[np.ndarray, np.ndarray]:
40 "Generate a sample dataset that y is a 2 dim circle."
41 rng = np.random.RandomState(1994)
42 X = np.sort(200 * rng.rand(100, 1) - 100, axis=0)
43 y = np.array([np.pi * np.sin(X).ravel(), np.pi * np.cos(X).ravel()]).T
44 y[::5, :] += 0.5 - rng.rand(20, 2)
45 y = y - y.min()
46 y = y / y.max()
47 return X, y
48
49
50def rmse_model(strategy: str, ax: Optional[matplotlib.axes.Axes]) -> None:

Callers 2

rmse_modelFunction · 0.85
custom_rmse_modelFunction · 0.85

Calls 2

minMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected