baybe.utils.sampling_algorithms.sample_numerical_df¶
- baybe.utils.sampling_algorithms.sample_numerical_df(df: DataFrame, n_points: int, *, method: DiscreteSamplingMethod = DiscreteSamplingMethod.Random)[source]¶
Sample data points from a numerical dataframe.
If the requested amount of points is larger than the number of available points, the entire dataframe will be returned as many times at it fits into the requested number and the specified sampling method will only return the remainder of points.
- Parameters:
df (
DataFrame
) – Dataframe with purely numerical entries.n_points (
int
) – Number of points to sample.method (
DiscreteSamplingMethod
) – Sampling method.
- Return type:
- Returns:
The sampled points.
- Raises:
TypeError – If the provided dataframe has non-numerical content.
ValueError – When an invalid sampling method was provided.