def _coerce_params(params):
    """Force xgboost parameters into appropriate types

    The output from hyperopt is always floats, but some xgboost parameters
    explicitly require integers. Cast those as necessary

    Parameters
    ----------
    params : dict
        xgboost parameters

    Returns
    -------
    dict
        Input parameters coerced as necessary
    """

    types = {
        'max_depth': int,
        'max_bin': int,
        'num_class': int,
        'silent': int,
    }
    retval = params.copy()
    for (k, val_type) in types.items():
        if k in params:
            retval[k] = val_type(params[k])
    return retval