docs: def get_experiment_fn(args):
    """Builds the experiment function for learn_runner.run.
  
    Args:
      args: the command line args
  
    Returns:
      A function that returns a tf.learn experiment object.
    """
  
    def get_experiment(output_dir):
      # Merge schema, input features, and transforms.
      train_config = util.merge_metadata(args.preprocess_output_dir,
                                         args.transforms_file)
  
      # Get the model to train.
      estimator = util.get_estimator(output_dir, train_config, args)
  
      # Save a copy of the scehma and input to the model folder.
      schema_file = os.path.join(args.preprocess_output_dir, util.SCHEMA_FILE)
  
      # Make list of files to save with the trained model.
      additional_assets = {'features.json': args.transforms_file,
                           util.SCHEMA_FILE: schema_file}
      if util.is_classification_model(args.model_type):
        target_name = train_config['target_column']
        vocab_file_name = util.CATEGORICAL_ANALYSIS % target_name
        vocab_file_path = os.path.join(
            args.preprocess_output_dir, vocab_file_name)
        assert file_io.file_exists(vocab_file_path)
        additional_assets[vocab_file_name] = vocab_file_path
  
      export_strategy_target = util.make_export_strategy(
          train_config=train_config,
          args=args,
          keep_target=True,
          assets_extra=additional_assets)
      export_strategy_notarget = util.make_export_strategy(
          train_config=train_config,
          args=args,
          keep_target=False,
          assets_extra=additional_assets)
  
      input_reader_for_train = get_reader_input_fn(
          train_config=train_config,
          preprocess_output_dir=args.preprocess_output_dir,
          model_type=args.model_type,
          data_paths=args.train_data_paths,
          batch_size=args.train_batch_size,
          shuffle=True,
          num_epochs=args.num_epochs)
  
      input_reader_for_eval = get_reader_input_fn(
          train_config=train_config,
          preprocess_output_dir=args.preprocess_output_dir,
          model_type=args.model_type,
          data_paths=args.eval_data_paths,
          batch_size=args.eval_batch_size,
          shuffle=False,
          num_epochs=1)
  
      return tf.contrib.learn.Experiment(
          estimator=estimator,
          train_input_fn=input_reader_for_train,
          eval_input_fn=input_reader_for_eval,
          train_steps=args.max_steps,
          export_strategies=[export_strategy_target, export_strategy_notarget],
          min_eval_frequency=args.min_eval_frequency,
          eval_steps=None,
      )
  
    # Return a function to create an Experiment.
    return get_experiment