Skip to content

plotting nnet function....

2 messages · akshay kulkarni, Ivan Krylov

#
Dear members,
                             I am using caret for modelling my data. It is a regression problem. My question is : how to plot the final model on the actual data points? The output of the model will be a nonlinear form of the activation function; I want to plot it on the data points. I have researched on web but to no effect. Like drawing a line on the original data points, for a linear model.

Thanking you,
Yours sincerely
AKSHAY M KULKARNI

[https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>  Virus-free.www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
#
? Sat, 27 Jul 2024 11:00:34 +0000
akshay kulkarni <akshay_e4 at hotmail.com> ?????:
Have you been able to obtain the predictions? What happens if you call
predict() on the model object returned to you by train()?

Once you have both the data and the prediction, it should be as simple
as plot(traindata$predictor_column, traindata$regressor_column);
lines(traindata$predictor_column, previously_returned_predictions). (Or
an equivalent with your favourite plotting system for R.)

Try following the vignette from the 'caret' package:
https://cran.r-project.org/package=caret/vignettes/caret.html

If you do encounter an error on your way or get stuck not knowing how
exactly to continue, please ask a more specific question.