Model Pipeline - Data transformation (TF Transform)
This pipeline shows how raw data is cleaned and changed using TensorFlow Transform before training a model. It makes data ready by scaling numbers and turning text into numbers.
This pipeline shows how raw data is cleaned and changed using TensorFlow Transform before training a model. It makes data ready by scaling numbers and turning text into numbers.
Loss
0.7 |****
0.6 |***
0.5 |**
0.4 |*
0.3 |*
0.2 |*
1 2 3 4 5 Epochs
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.65 | 0.60 | Model starts learning with moderate loss and accuracy. |
| 2 | 0.48 | 0.75 | Loss decreases and accuracy improves as model learns. |
| 3 | 0.35 | 0.82 | Model continues to improve with better predictions. |
| 4 | 0.28 | 0.87 | Loss lowers further; accuracy nearing good performance. |
| 5 | 0.22 | 0.90 | Training converges with low loss and high accuracy. |
age by its mean and variance?tft.scale_to_z_score to scale features by mean and variance.tft.scale_to_z_score correctly; others use incorrect or arbitrary scaling.{'income': 50000} if the dataset mean income is 40000 and stddev is 10000?
def preprocessing_fn(inputs):
income_scaled = tft.scale_to_z_score(inputs['income'])
return {'income_scaled': income_scaled}def preprocessing_fn(inputs):
age_bucketized = tft.bucketize(inputs['age'], num_buckets=5)
return {'age_bucketized': age_bucketized}
What is the likely cause of the error?height and categorical feature color. You want to scale height and one-hot encode color. Which preprocessing function correctly applies these transformations?tft.scale_to_z_score to scale 'height' correctly.tft.compute_and_apply_vocabulary, then apply tf.one_hot with correct depth.Pass the test and this pattern moves unknown