dora/active_sampling/base_sampler.py
def random_sample(lower, upper, n):
    """
    Used to randomly sample the search space.

    Provide search parameters and the number of samples desired.

    Parameters
    ----------
    lower : array_like
        Lower or minimum bounds for the parameter space
    upper : array_like
        Upper or maximum bounds for the parameter space
    n : int
        Number of samples

    Returns
    -------
    np.ndarray
        Sampled location in feature space
    """
    dims = len(lower)
    X = np.random.random((n, dims))
    volume_range = [upper[i] - lower[i] for i in range(dims)]
    X_scaled = X * volume_range
    X_shifted = X_scaled + lower
    return X_shifted

    Used to randomly sample the search space.

    Provide search parameters and the number of samples desired.

    Parameters
    ----------
    lower : array_like
        Lower or minimum bounds for the parameter space
    upper : array_like
        Upper or maximum bounds for the parameter space
    n : int
        Number of samples

    Returns
    -------
    np.ndarray
        Sampled location in feature space
    
Used to randomly sample the search space.
Provide search parameters and the number of samples desired.

Parameters

lower : array_like
Lower or minimum bounds for the parameter space
upper : array_like
Upper or maximum bounds for the parameter space
n : int
Number of samples

Returns

np.ndarray
Sampled location in feature space
Used to randomly sample the search space . Provide search parameters and the number of samples desired . Parameters lower : array_like Lower or minimum bounds for the parameter space upper : array_like Upper or maximum bounds for the parameter space n : int Number of samples Returns np . ndarray Sampled location in feature space
def random_sample(lower, upper, n):
    dims = len(lower)
    X = np.random.random((n, dims))
    volume_range = [upper[i] - lower[i] for i in range(dims)]
    X_scaled = X * volume_range
    X_shifted = X_scaled + lower
    return X_shifted
def random_sample ( lower , upper , n ) : dims = len ( lower ) X = np . random . random ( ( n , dims ) ) volume_range = [ upper [ i ] - lower [ i ] for i in range ( dims ) ] X_scaled = X * volume_range X_shifted = X_scaled + lower return X_shifted
Used to randomly sample the search space.
Used to randomly sample the search space .
"""
    Used to randomly sample the search space.

    Provide search parameters and the number of samples desired.

    Parameters
    ----------
    lower : array_like
        Lower or minimum bounds for the parameter space
    upper : array_like
        Upper or maximum bounds for the parameter space
    n : int
        Number of samples

    Returns
    -------
    np.ndarray
        Sampled location in feature space
    """
lower
upper
n