Helloif i want to calculate the residual of neural network prediction in claasification problem for detecting outlierwhat formula should i use for calculate residual? does the software do that?
Hi @maryam_nourmand,
If you use a model to predict continuous numerical values, some models enable you to directly save the residuals in your data table by clicking on the red triangle, choose "Save Columns", and then "Residuals". For Neural Networks, you'll need some manual work, saving the prediction formula in your table (red triangle, "Save Formulas" or "Save Fast Formulas"), and then creating a new column "Residuals" with a formula : Actual value - Predicted value
Note that you already have options to plot "Residual by Predicted" graph in the Neural Network platform, when clicking on the red triangle.
If you use a model to predict classes, you won't have residuals but you have information about misclassification and calculated probabilities. You can then save these probabilities columns (same options than before), and try to understand where are the errors, for example by plotting the probabilities of the main class predicted and see if the classification probability threshold needs to be adjusted.
If you are interested about evaluating classification models, there are also various plots that helps you evaluate the performance of your classifier model : ROC Curve, Lift curve, confusion matrix, ...
Hope this answer will help you,
but we can calculate residual in logistic regressionits a kind of classification model tooi attach the pic of formula of calculate deviance residual for thatnow i want to know when i use neural network for a classification problemhow can i calculate residual for that too?
Indeed, you can calculate deviance in generalized linear models : Statistical Details for Model Selection and Deviance
For example on the JMP dataset "Detergent", using "brand" as categorical response Y, I do have the options to calculate directly the deviance residuals and save them in the datatable :
Deviance is an indication about goodness-of-fit for statistical models where model fitting is achieved by maximum likekihood, which may not be used for Machine Learning models that use different loss functions : Deviance (statistics) - Wikipedia
So it may not be possible to calculate it for some models using different fitting functions.
so what is the equal consept of residual in statistical models in Machine Learning models ?but i think we have probability for each class in Machine Learning models so we should can calculate residual for that too