def fit_predict_for_chain(chain, train_input, predict_input):
    """ Function apply fit and predict operations

    :param chain: chain to process
    :param train_input: InputData for fit
    :param predict_input: InputData for predict

    :return preds: prediction of the chain
    """
    # Fit it
    chain.fit_from_scratch(train_input)

    # Predict
    predicted_values = chain.predict(predict_input)
    preds = predicted_values.predict

    return preds