In this recipe, we implemented a DNN regressor using a pre-made estimator; the preceding program can be divided into a variety of subparts, as follows:
- Define the feature columns: In step 1, we created a vector of strings, which contains the names of our numeric feature columns. Next, we called the feature_columns() function, which defines the expected shape value of an input tensor and how features should be transformed (numeric or categorical) while they're being modeled. In our case, the shape of the input tensor was 784, and all the values of the input tensor were numerical. We transform the numeric features by providing the names of the numeric columns to the column_numeric() function within feature_columns(). If you ...