src/orion/analysis/lpi_utils.py
def make_grid(point, space, model, n_points):
    """Build a grid based on point.

    The shape of the grid will be
        (number of hyperparameters,
         number of points ``n_points``,
         number of hyperparameters + 1)

    Last column is the objective predicted by the model for a given point.

    Parameters
    ----------
    point: numpy.ndarray
        A tuple representation of the best trials, (hyperparameters + objective)
    space: Space object
        A space object from an experiment. It must be flattened and linearized.
    model: `sklearn.base.RegressorMixin`
        Trained regressor used to compute predictions on the grid
    n_points: int
        Number of points for each dimension on the grid.

    """
    grid = numpy.zeros((len(space), n_points, len(space) + 1))
    for i, dim in enumerate(space.values()):
        grid[i, :, :] = point
        grid[i, :, i] = numpy.linspace(*dim.interval(), num=n_points)
        grid[i, :, -1] = model.predict(grid[i, :, :-1])
    return grid
Build a grid based on point.

    The shape of the grid will be
        (number of hyperparameters,
         number of points ``n_points``,
         number of hyperparameters + 1)

    Last column is the objective predicted by the model for a given point.

    Parameters
    ----------
    point: numpy.ndarray
        A tuple representation of the best trials, (hyperparameters + objective)
    space: Space object
        A space object from an experiment. It must be flattened and linearized.
    model: `sklearn.base.RegressorMixin`
        Trained regressor used to compute predictions on the grid
    n_points: int
        Number of points for each dimension on the grid.

    
Build a grid based on point.
The shape of the grid will be
(number of hyperparameters,
number of points ``n_points``,
number of hyperparameters + 1)

Last column is the objective predicted by the model for a given point.

Parameters

numpy.ndarray
A tuple representation of the best trials, (hyperparameters + objective)
space: Space object
A space object from an experiment. It must be flattened and linearized.
model: `sklearn.base.RegressorMixin`
Trained regressor used to compute predictions on the grid
n_points: int
Number of points for each dimension on the grid.
Build a grid based on point . The shape of the grid will be ( number of hyperparameters number of points ` ` n_points ` ` number of hyperparameters + 1 ) Last column is the objective predicted by the model for a given point . Parameters numpy . ndarray A tuple representation of the best trials ( hyperparameters + objective ) space : Space object A space object from an experiment . It must be flattened and linearized . model : ` sklearn . base . RegressorMixin ` Trained regressor used to compute predictions on the grid n_points : int Number of points for each dimension on the grid .
def make_grid(point, space, model, n_points):
    grid = numpy.zeros((len(space), n_points, len(space) + 1))
    for i, dim in enumerate(space.values()):
        grid[i, :, :] = point
        grid[i, :, i] = numpy.linspace(*dim.interval(), num=n_points)
        grid[i, :, -1] = model.predict(grid[i, :, :-1])
    return grid
def make_grid ( point , space , model , n_points ) : grid = numpy . zeros ( ( len ( space ) , n_points , len ( space ) + 1 ) ) for i , dim in enumerate ( space . values ( ) ) : grid [ i , : , : ] = point grid [ i , : , i ] = numpy . linspace ( * dim . interval ( ) , num = n_points ) grid [ i , : , - 1 ] = model . predict ( grid [ i , : , : - 1 ] ) return grid
Build a grid based on point.
Build a grid based on point .
"""Build a grid based on point.

    The shape of the grid will be
        (number of hyperparameters,
         number of points ``n_points``,
         number of hyperparameters + 1)

    Last column is the objective predicted by the model for a given point.

    Parameters
    ----------
    point: numpy.ndarray
        A tuple representation of the best trials, (hyperparameters + objective)
    space: Space object
        A space object from an experiment. It must be flattened and linearized.
    model: `sklearn.base.RegressorMixin`
        Trained regressor used to compute predictions on the grid
    n_points: int
        Number of points for each dimension on the grid.

    """
point
space
model
n_points