The TensorFlow Estimator library provides a high-level API for training machine learning models, simplifying the process of training, evaluating, and predicting. While still maintained for existing projects, it is officially not recommended for new code, with Keras being the preferred API in modern TensorFlow. It generally follows the TensorFlow core release cadence.
pip install tensorflow-estimatorVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create, train, and make predictions with a `DNNRegressor` using `tf.estimator`. It defines a simple input function for training and prediction, and then trains the model for a few steps before predicting on new data.
For new projects, use `tf.keras.Model` or `tf.keras.Sequential` directly. For existing projects, consider migrating your Estimator code to Keras as part of a modernization effort.
If migrating is not feasible, ensure you understand the execution model of Estimators. For advanced use cases or when eager execution is critical, Keras is the recommended path.
Always install the main `tensorflow` package (e.g., `pip install tensorflow`) to ensure all necessary components, including Estimator, are correctly set up and accessible via `import tensorflow as tf`.