def walk_forward_validation(data, n_test, cfg):
    predictions = list()
    (train, test) = train_test_split(data, n_test)
    model = model_fit(train, cfg)
    history = [x for x in train]
    for i in range(len(test)):
        yhat = model_predict(model, history, cfg)
        predictions.append(yhat)
        history.append(test[i])
    error = measure_rmse(test, predictions)
    print((' > %.3f' % error))
    return error
def walk_forward_validation(data, n_test, cfg):
    predictions = list()
    (train, test) = train_test_split(data, n_test)
    model = model_fit(train, cfg)
    history = [x for x in train]
    for i in range(len(test)):
        yhat = model_predict(model, history, cfg)
        predictions.append(yhat)
        history.append(test[i])
    error = measure_rmse(test, predictions)
    print((' > %.3f' % error))
    return error