This code implements a time series forecasting model for predicting the ground water level using RNN-LSTM deep learning approach in TensorFlow.
The following is a summary of the code:
• Importing required libraries such as NumPy, Pandas, Scikit-Learn, Keras, TensorFlow, and Matplotlib. • Accessing data from an API endpoint. • Converting API response to Pandas DataFrame. • Preprocessing the data by converting the date_mesure field to datetime format and selecting the required columns. • Splitting the data into training and testing sets. • Scaling the data using MinMaxScaler. • Creating supervised data by creating sequences of inputs and outputs. • Defining the LSTM model with two layers. • Compiling the model with the RMSprop optimizer and mean squared error loss function. • Fitting the model to the training data and evaluating it on the validation set. • Plotting the training and validation loss over the epochs. • Generating the forecasts and evaluating the model performance using mean squared error.