CNN (Convolutional Neural Networks) models are mainly useful when we apply them for training a multi-dimensional type of data such as an image. But they are not limited to this purpose only, we can also implement the CNN model for regression data analysis. We saw the CNN model regression with Python in the previous

post and in this tutorial, we'll implement the same method in R.

We use a 1-dimensional convolutional function to apply the CNN model. We need Keras R interface to use the Keras neural network API in R. You need to install it if it is not available on your development environment. The tutorial covers:

- Preparing the data
- Defining and fitting the model
- Predicting and visualizing the results
- Source code listing

We'll start by loading the required libraries for this tutorial.

library(keras)
library(caret)