- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can Tensorflow and Estimator be used to view all feature column transformations at once?
All the feature columns of the dataset can be viewed using Tensorflow and Estimator with the help of the ‘DenseFeatures’ method. This data is converted into Numpy array so that it can be viewed on the console.
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.
We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and requires zero configuration and free access to GPUs (Graphical Processing Units). Colaboratory has been built on top of Jupyter Notebook.
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.
Example
print("Viewing all feature column transformation together") tf.keras.layers.DenseFeatures(feature_columns)(example).numpy()
Code credit −https://www.tensorflow.org/tutorials/estimator/boosted_trees
Output
Viewing all feature column transformation together array([[22. , 1. , 0. , 1. , 0. , 0. , 1. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 1. , 0. , 0. , 0. , 7.25, 1. , 0. , 0. , 0. , 0. , 0. , 0. , 1. , 0. , 0. , 0. , 0. , 0. , 1. , 0. ]], dtype=float32)
Explanation
- All of the feature column transofrmations can be viewed together.
- It can be done using the ‘DenseFeatures’ method.
- This transformation is displayed on the console.
- Related Articles
- How can Tensorflow be used with Estimator to transform the feature column?
- How can Tensorflow be used to instantiate an estimator using Python?
- How can Tensorflow be used to define feature columns in Python?
- How can Tensorflow be used with premade estimator to download the Iris dataset?
- How can Tensorflow be used with Estimator to compile the model using Python?
- How can Tensorflow be used with Estimator to make predictions from trained model?
- How can Tensorflow be used with Estimator to predict the output using Python?
- How can Tensorflow and pre-trained model be used for feature extraction?
- How can Tensorflow and Estimator be used to find the ROC curve on titanic dataset?
- How can Tensorflow and Estimator be used with Boosted trees to train and evaluate the model?
- How can Tensorflow be used to create a feature extractor using Python?
- How can Tensorflow be used with Estimators to create feature columns and input functions?
- How Tensorflow be used for the gender column, like feature column helping in prediction?
- How can Tensorflow and Estimator be used to define input function for training and evaluation of dataset?
- How can Tensorflow be used with Estimators for feature engineering the model?
