Getting ready

In this recipe, we'll demonstrate how to build and fit a deep learning model using the Estimator API. To use the Estimator API in R, we need to install the tfestimators package.

First, let's install the library and then import it into our environment:

install.packages("tfestimators")
library(tfestimators)

Next, we need to simulate some dummy data for this exercise:

x_data_df <- as.data.frame( matrix(rnorm(1000*784), nrow = 1000, ncol = 784))
y_data_df <- as.data.frame(matrix(rnorm(1000), nrow = 1000, ncol = 1))

Let's rename the response variable to target:

colnames(y_data_df)<- c("target")

Now, let's bind the x and y data together to prepare the training data:

dummy_data_estimator <- cbind(x_data_df,y_data_df)

By doing this, we have created our input dataset.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset