Generate a sample dataset that y is a 2 dim circle.
()
| 37 | |
| 38 | |
| 39 | def 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 | |
| 50 | def rmse_model(strategy: str, ax: Optional[matplotlib.axes.Axes]) -> None: |
no test coverage detected