human
2. Data Preprocessing
For data preprocessing and transformation, we use TensorFlow Transform to perform the following:
1. Implement transformation logic in preprocess_fn
2. Analyze and transform training data.
4. Transform evaluation data.
5. Save transformed data, transform schema, and trasform logic.
2.1 Implement preprocess_fn"
Please write code following the instructions in jupyter notebook style.

=====
What is a code to 2?
assistant
#Here is code to 2.

def make_preprocessing_fn(raw_schema):

  def preprocessing_fn(input_features):

    processed_features = {}

    for feature in raw_schema.feature:
      feature_name = feature.name
      
      if feature_name in ['income_bracket']:
        processed_features[feature_name] = input_features[feature_name]
      elif feature_name in ['fnlwgt']:
        # Scale weights to be less than 1.0
        processed_features[feature_name + "_scaled"] = (
            tf.cast(input_features[feature_name], tf.float32) / 
            tf.cast(tft.max(input_features[feature_name]), tf.float32))
      elif feature.type == 1:
        # Extract vocabulary and integerize categorical features.
        processed_features[feature_name+"_integerized"] = (
            tft.compute_and_apply_vocabulary(input_features[feature_name], vocab_filename=feature_name))
      else:
        # normalize numeric features.
        processed_features[feature_name+"_scaled"] = tft.scale_to_z_score(input_features[feature_name])

    # Bucketize age using quantiles. 
    quantiles = tft.quantiles(input_features["age"], num_buckets=5, epsilon=0.01)
    processed_features["age_bucketized"] = tft.apply_buckets(
      input_features["age"], bucket_boundaries=quantiles)

    return processed_features

  return preprocessing_fn