How can Tensorflow be used with Estimators to display metadata about the dataset?


Metadata about the dataset can be displayed using the ‘describe’ method, as well as by visualizing the dataset, with specific statistic. The ‘hist’ method can be used to visualize a histogram with respect to a specific column.

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.

Let us understand how Estimators can be used.

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.

Example

print("More data about age")
dftrain.age.hist(bins=20)
plt.show()

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

Output

Explanation

  • The column ‘age’ is visualized on the graph, to understand more about the type of passengers.

Updated on: 25-Feb-2021

70 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements