From the course: Deep Learning: Getting Started
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Building a spam model
From the course: Deep Learning: Getting Started
Building a spam model
- Once the text data, is converted to numeric representations, the process of building and evaluating the model, is the same as structure data. Code for this video, is available in section 5.3 of the spam classification notebook. We start by defining the number of target classes, and the number of hidden nodes. We define the number of target classes to two, and the number of nodes in the hidden layer to 32. We begin to create a sequential model. We add two hidden layers of 32 nodes. We then add an output layer, with two nodes and softmax activation, we compile the model with categorical crossentropy, as the loss function, we finally print the model. Let's run this code and check the model. The model is now created, we can now perform training. We set the batch size to 256 and epochs to 10. We use 20% of the data for validation. We then fit the model and plot the accuracy. Finally, we also evaluate the model, let's run this code now, we see the accuracy reaching high 90% values as part…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.