def _check_estimator(estimator):
    """Make sure that an estimator implements the necessary methods."""
    if not hasattr(estimator, 'decision_function') and not hasattr(estimator,
        'predict_proba'):
        raise ValueError(
            'The base estimator should implement decision_function or predict_proba!'
            )
