Home > front end >  R visualization of correct predictions
R visualization of correct predictions

Time:05-05

i have trained SVM classification models based on probability prediction for recognision numbers 0-9. I have visualization of probality for every model, looks like this for number 0 -data of probability are in variable prediction0 enter image description here

Then i have trained final classificator and i have 1423 correct observations (from 1499) - i have vector c= containing numbers correctly predicted enter image description here

What i need to do, is when was 0 correctly predicted in vector c, mark that point on red on this graf. If it helps i have "ck" containing probalities for all number prediction for every test sample, where i get maximum probality, which was my final prediction.

CodePudding user response:

You can do this by using the col argument. I'll use the mtcars dataset as an example

plot(
  mpg~disp,
  data=mtcars,
  col=ifelse(mtcars$am==0,"red","blue")
)
  • Related