public class BinaryClassificationEx1 extends Object implements Serializable
Trains a 3-layer network with a binary output variable and 4 categorical input attributes.
This example trains a 3-layer network using 48 training patterns from four nominal input attributes. The first two nominal attributes have two classifications. The third and fourth nominal attributes have three and four classifications, respectively. All four attributes are encoded using binary encoding. This results in eleven binary input columns. The output class is defined to be 1 if the first two nominal attributes sum to 1, and 0 otherwise. Note that since the relationship between input and output is deterministic, the network will fit the data with 0 error.
The structure of the network consists of eleven input nodes and three layers, with three perceptrons in the first hidden layer, two perceptrons in the second hidden layer, and one perceptron in the output layer.
With 11 inputs, 3 and 2 perceptrons in the hidden layers, and 1 output perceptron, there are a total of 47 weights in this network, including the six bias weights. The linear activation function is used for both hidden layers. Since the target output is binary the logistic activation function is used in the output layer. Training is conducted using the quasi-Newton trainer with the binary-entropy error function provided by the BinaryClassification class.
Constructor and Description |
---|
BinaryClassificationEx1() |
Copyright © 2020 Rogue Wave Software. All rights reserved.