def regression(regressor, X_train, X_test, y_train):
    """
    Common regression function.
    :param regressor: regressor instance
    :param X_train: train features
    :param X_test: test features
    :param y_train: train output
    :return: predicted output
    """
    regressor.fit(X_train, y_train)
    y_pred = regressor.predict(X_test)
    return y_pred