0

I'm using a ML model in R, the monotone multilayer preceptor monmlp. The code is in a Jupiter notebook but everytime I run the code, this text appears:

** Ensemble 1 
Complex eigenvalues found for method = BFGS 
coefficients for function value 0.1470859  :
[1] -3.282513e+04  9.024432e+03 -5.661244e+02 -1.186757e+02 -1.161211e+02
[6] -7.218868e+02 -1.542379e+02 -3.208072e+03 -8.870390e+02  7.172020e+01
[11] -6.561170e+02 -6.503717e+01 -3.924954e+02 -8.839299e+02 -3.001464e+01
[16] -3.364653e+02 -2.144342e+03 -8.295099e+02 -2.695734e+01 -4.049469e+02
[21] -2.951475e+02  4.755736e-02 -4.859001e+02 -3.165129e+02 -6.570702e+02
[26] -2.391308e+02 -6.363910e+02 -3.076146e+02 -7.038366e-02 -3.216109e+02
[31] -1.034578e+03 -3.393751e+02 -1.278390e+02  5.621617e+01 -6.313013e+02
...

And continues until the model is finished. This makes my Jupyter notebook longer than necessary.

I tried to hide this text with this code before running the model:

options(warn=-1, verbose=FALSE)
models <- c("Rborist","rf","ranger","wsrf","glm","monmlp","gbm")
fits <- lapply(models, function(model){
print(model)
train(Approve.Loan ~ ., method = model, data = train_set[,-1] )
})

But it doesn't work. Could you please suggest a solution?

Regards,

Alexis

Alexis
  • 2,104
  • 2
  • 19
  • 40
  • Have you tried invisible? https://stackoverflow.com/questions/2723034/suppress-one-commands-output-in-r?rq=1 – kath Oct 04 '19 at 06:55
  • @kath Thank you for your comment, but it doesn't work. I tried invisible() inside and outside the lapply without success. – Alexis Oct 04 '19 at 20:47

0 Answers0