jasmine.datasets.generate_polynomial
- jasmine.datasets.generate_polynomial(n_samples: int = 100, degree: int = 2, noise: float = 0.0, bias: float = 0.0, coef: bool = False, random_state: int | None = None)[source]
Generate a polynomial regression problem with one feature.
- Parameters:
n_samples – The number of samples.
degree – The degree of the polynomial relationship.
noise – The standard deviation of the Gaussian noise.
bias – The bias term (intercept).
coef – If True, the ground truth coefficients and bias are returned.
random_state – Seed for the random number generator.
- Returns:
By default, returns (X, y). X will have a shape of (n_samples, 1). If coef is True, returns (X, y, ground_truth_coefficients, bias).