In this short post I want to quickly demonstrate how the most basic neural network (no hidden layer) gives us the same results as the linear model.

First we need data

We can now specify a model.

Let’s start by estimating a linear model.

Now lets use the built in nnet package to estimate a neural network without a hidden layer.

Let look at the results next to each other.

We can also estimate this model using the neuralnet package (this package needs to be installed first using install.packages("neuralnet")). This package allows us to nicely visualise the results.

Of course it only becomes interesting if we include a hidden layer.

In the keynote at African Peering Forum (AfPIF) 2016 I presented the Promoting Content in Africa report written together with Michael Kende, these are the...

The sigmoid package makes it easy to become familiar with the way neural networks work by demonstrating the key concepts using straightforward code examples.