2

I'm using the Caret package from R to create prediction models for maximum energy demand. What i need to use is neural network multilayer perceptron, but in the Caret package i found out there's 2 of the mlp method, which is "mlp" and "mlpML". what is the difference between the two?

I have read description from a book (Advanced R Statistical Programming and Data Models: Analysis, Machine Learning, and Visualization) but it still doesnt answer my question.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user183458
  • 21
  • 4

2 Answers2

1

Caret has 238 different models available! However many of them are just different methods to call the same basic algorithm.

Besides mlp there are 9 other methods of calling a multi-layer-perceptron one of which is mlpML. The real difference is only in the parameters of the function call and which model you need depends on your use case and what you want to adapt about the basic model.

Chances are, if you don't know what mlpML or mlpWeightDecay,etc. does you are fine to just use the basic mlp.

Looking at the official documentation we can see that:

mlp(size) while mlpML(layer1,layer2,layer3) so in the first method you can only tune the size of the multi-layer-perceptron while in the second call you can tune each layer individually.

Fnguyen
  • 1,159
  • 10
  • 23
  • I don't think this answer is accurate: the difference between `mlp` and `mlpML` is not that with `mlp` you cannot set the size of individual layers, but that there is always exactly one hidden layer. – Mathias Müller May 12 '20 at 08:30
0

Looking at the source code here:

https://github.com/topepo/caret/blob/master/models/files/mlp.R

and here:

https://github.com/topepo/caret/blob/master/models/files/mlpML.R

It seems that the difference is that mlpML allows several hidden layers:

modelInfo <- list(label = "Multi-Layer Perceptron, with multiple layers",

while mlp has one single layer with hidden units.


The official documentation also hints at this difference. In my opinion, it is not particularly useful to have many different models that differ only very slightly, and the documentation does not explain those slight differences well.

Mathias Müller
  • 22,203
  • 13
  • 58
  • 75