[R] How to use preProcess in Caret?

William Michels wjm1 @end|ng |rom c@@@co|umb|@@edu
Wed Dec 4 19:04:08 CET 2019


Hello,

Have you tried alternative methods of pre-processing your data, such
as simply calling scale()? What is the effect on convergence, for both
the caret package and and the neuralnet package? There's an example
using scale() with the neuralnet package at the link below:

https://datascienceplus.com/fitting-neural-network-in-r/

HTH, Bill.

W. Michels, Ph.D.



On Sun, Dec 1, 2019 at 10:04 AM Burak Kaymakci <burakaymakci using gmail.com> wrote:
>
> Hello there,
>
> I am using caret and neuralnet to train a neural network to predict times
> table. I am using 'backprop' algorithm for neuralnet to experiment and
> learn.
>
> Before using caret, I've trained a neuralnet without using caret, I've
> normalized my input & outputs using preProcess with 'range' method. Then I
> predicted my test set, did the multiplication and addition on predictions
> to get the real values. It gave me good results.
>
> What I want to ask is, when I try to train my network using caret, I get an
> error saying algorithm did not converge. I am thinking that I might be
> doing something wrong with my pre-processing,
>
> How would I go about using preProcess in train?
> Do I pass my not-normalized data set to the train function and train
> function handles normalization internally?
>
> You can find my R gist here
> <https://gist.github.com/andreyuhai/f299282f5a827e2a27c586afc9eb4eb5>
>
> Thank you,
> Burak
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list