def _validate_param_grid(param_grid):
    """Check if the parameter values are valid

    This basically does the same checks as in the constructor of the 
    :class:`~.core.GenSVM` class, but for the entire parameter grid.

    """
    conditions = {'p': lambda x: 1.0 <= x <= 2.0, 'kappa': lambda x: x > -
        1.0, 'lmd': lambda x: x > 0, 'epsilon': lambda x: x > 0, 'gamma': 
        lambda x: x != 0, 'weights': lambda x: x in ['unit', 'group']}
    for param in conditions:
        if param in param_grid:
            if not all(map(conditions[param], param_grid[param])):
                raise ValueError('Invalid value in grid for parameter: %s.' %
                    param)
