make_sine_data

data.make_sine_data(n_samples=100, sd=1, X_low=-6, X_high=6, random_seed=None)

Generate data for nonlinear regression.

Parameters

Name Type Description Default
n_samples int Number of samples to generate. 100
sd float Standard deviation of the normally distributed errors. 1
X_low float Lower bound for simulated X values. -6
X_high float Upper bound for simulated X values. 6
random_seed int Seed to control randomness. None

Returns

Type Description
tuple A tuple containing the X and y arrays. X is a 2D array with shape (n_samples, 1) and y is a 1D array with shape (n_samples,). X contains the simulated X values and y contains the corresponding sine values with added normally distributed errors.