plot.nn
, a method for the plot
generic. It is designed for an
inspection of the weights for objects of class nn
, typically produced
by neuralnet
.
# S3 method for nn
plot(x, rep = NULL, x.entry = NULL, x.out = NULL,
radius = 0.15, arrow.length = 0.2, intercept = TRUE,
intercept.factor = 0.4, information = TRUE, information.pos = 0.1,
col.entry.synapse = "black", col.entry = "black",
col.hidden = "black", col.hidden.synapse = "black",
col.out = "black", col.out.synapse = "black",
col.intercept = "blue", fontsize = 12, dimension = 6,
show.weights = TRUE, file = NULL, ...)
an object of class nn
repetition of the neural network. If rep="best", the repetition with the smallest error will be plotted. If not stated all repetitions will be plotted, each in a separate window.
x-coordinate of the entry layer. Depends on the arrow.length in default.
x-coordinate of the output layer.
radius of the neurons.
length of the entry and out arrows.
a logical value indicating whether to plot the intercept.
x-position factor of the intercept. The closer the factor is to 0, the closer the intercept is to its left neuron.
a logical value indicating whether to add the error and steps to the plot.
y-position of the information.
color of the synapses leading to the input neurons.
color of the input neurons.
color of the neurons in the hidden layer.
color of the weighted synapses.
color of the output neurons.
color of the synapses leading away from the output neurons.
color of the intercept.
fontsize of the text.
size of the plot in inches.
a logical value indicating whether to print the calculated weights above the synapses.
a character string naming the plot to write to. If not stated, the plot will not be saved.
arguments to be passed to methods, such as graphical parameters
(see par
).
# NOT RUN {
XOR <- c(0,1,1,0)
xor.data <- data.frame(expand.grid(c(0,1), c(0,1)), XOR)
print(net.xor <- neuralnet( XOR~Var1+Var2, xor.data, hidden=2, rep=5))
plot(net.xor, rep="best")
# }
Run the code above in your browser using DataLab