import tensorflow as tf

    features[TIMESERIES_COL] = tf.squeeze(features[TIMESERIES_COL], axis = [2])

    return tf.estimator.export.ServingInputReceiver(features, feature_placeholders)

# Create custom estimator's train and evaluate function
def train_and_evaluate(output_dir, use_keras):
    if use_keras:
       estimator = make_keras_estimator(output_dir)
    else:
       estimator = tf.estimator.Estimator(model_fn = simple_rnn, 
                                          model_dir = output_dir)
    train_spec = tf.estimator.TrainSpec(read_dataset('train.csv',
                                            tf.estimator.ModeKeys.TRAIN,
                                            512),
                                        max_steps = 1000)
    exporter = tf.estimator.LatestExporter('exporter', serving_input_fn)
    eval_spec = tf.estimator.EvalSpec(read_dataset('valid.csv',
                                            tf.estimator.ModeKeys.EVAL,
