LSTM using the iris dataset
Continuing with the LSTM architecture for RNN introduced in Chapter 6, Recurrent and Convolutional Neural Networks, we present the iris
dataset processing using the mxnet
LSTM function. The function expects all inputs and outputs as numeric. It is particularly useful for processing text sequences, but here we will train an LSTM model on the iris
dataset. The input values are petal.length
, petal.width
, sepal.length
, and sepal.width
. The output variable is Species
, which is converted to a numeric value between one and three. The iris
dataset has been detailed in Chapter 4, Perceptron Neural Network Modeling – Basic Models:
################################################################# ### Chapter 7 - Neural Networks with R - Use cases ######### ### Prediction using LSTM on IRIS dataset ######### ################################################################# ##Required one time library("mxnet") data(iris) x = iris[1:5!=5,-5] y = as.integer...