# Confusion matrix terminology

I am working on machine learning with a supervised problem with 2 classes: NO and YES, and I need some precision about confusion matrix. I read 2 differents terminologies, some writes matrix confusion as: $$\begin{pmatrix} & &\text{Positive Prediction} &\text{Negative Prediction}\\ &\text{Actual Positive Class} &TP &FP \\ &\text{Actual Negative class} &FN &TN \end{pmatrix}$$ where TP = true positive, FP = false positive, FN = false negative, and TN = true negative.

And I also saw, the confusion matrix written like that: $$\begin{pmatrix} & &\text{Predicted NO} &\text{Predicted YES}\\ &\text{Actual NO Class} &TN &FP \\ &\text{Actual YES class} &FN &TP \end{pmatrix}$$

TP and TN are inverted. Which one is corrected, especially for my problem? Thanks.