- Related Questions & Answers
- How can Tensorflow be used with Estimators to explore the titanic data?
- How can Tensorflow be used with estimators to visualize the titanic data?
- How can Tensorflow be used with Estimators to optimize the model?
- How can Tensorflow be used with Estimators to define a function that shuffles data?
- How can Tensorflow be used with Estimators to visualize the data, and the ROC curve?
- How can Tensorflow be used with Estimators to split the iris dataset?
- How can Tensorflow be used with Estimators for feature engineering the model?
- How can Tensorflow be used with Estimators to return a two element tuple?
- How can Tensorflow be used with Estimators to evaluate the model using Python?
- How can Tensorflow be used with Estimators to display metadata about the dataset?
- How can Tensorflow be used with Estimators to inspect the titanic dataset using Python?
- How can Tensorflow be used with Estimators to train the model for titanic dataset?
- How can Tensorflow be used with Estimators to create feature columns and input functions?
- How can Tensorflow be used with Estimators to add a column to the titanic dataset?
- How can Tensorflow be used with Estimators to inspect a specific column of titanic dataset?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Data transformation can be performed on the titanic dataset with the help of the ‘DenseFeatures’ method. The columns that need to be transformed, are converted into a Numpy array.

**Read More:**
What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?

We will use the Keras Sequential API, which is helpful in building a sequential model that is used to work with a plain stack of layers, where every layer has exactly one input tensor and one output tensor.

A neural network that contains at least one layer is known as a convolutional layer. We can use the Convolutional Neural Network to build learning model.

An Estimator is TensorFlow's high-level representation of a complete model. It is designed for easy scaling and asynchronous training. Estimators use feature columns to describe how the model would interpret the raw input features. An Estimator expects a vector of numeric inputs, and feature columns will help describe how the model should convert every feature in the dataset.

Selecting and using the right set of feature columns is essential to learning an effective model. A feature column can be one of the raw inputs in the original features dict, or a new column created using transformations that are defined on one or multiple base columns.

The linear estimator uses as well as numeric and categorical features. Feature columns work with all the TensorFlow estimators. Their goal is to define the features used for modeling. They also have feature engineering capabilities like one-hot-encoding, normalization, and bucketization.

print("A categorial column is transformed to an indicator column") gender_column = feature_columns[0] tf.keras.layers.DenseFeatures([tf.feature_column.indicator_column(gender_column)])(feature_batch).numpy()

Code credit −https://www.tensorflow.org/tutorials/estimator/linear

A categorial column is transformed to an indicator column array([[1., 0.], [0., 1.], [0., 1.], [1., 0.], [1., 0.], [1., 0.], [0., 1.], [0., 1.], [1., 0.], [1., 0.]], dtype=float32)

DenseFeatures accepts dense tensors.

This is done to inspect a categorical column which needs to be transformed.

It is transformed to an indicator column first before any other computation.

Advertisements