def train_and_predict(train_x, train_y, val_x, model_cls, return_model=False, **model_params):
    """Convenience function that trains a model on one dataset and predicts
    on another, given a model class and a set of parameters.

    Parameters
    ----------
    train_x, val_x: pd.DataFrame,
        The datasets to train and predict on respectively.
    train_y: array-like,
        The true labels/targets of train_x.
    model_cls: uninitialized predictor class,
        Must implement the '.predict' and '.fit' methods. Every Scikit-Learn
        predictor suffices.
    **model_params: key-value pairs,
        Any parameters that should be used to initialize the model_cls.

    Returns
    -------
    predictions: array,
        The predicted labels for val_x.
    """
    model = model_cls(**model_params)
    model.fit(train_x, train_y)
    predictions = model.predict(val_x)
    if return_model:
        return predictions, model
    else:
        return predictions