In Market basket analysis, confidence represents the likelihood of buying both items A and B. Confidence is calculated as the number of transactions involving both A and B divided by the number of transactions involving only item A.
Confidence (A=>B) = (Number of transactions involving both A and B)/ (Number of transactions involving only A)
If you want to learn Market basket analysis and other recommendation systems, I suggest enrolling in these Data Scientist by Intellipaat.
You can watch this video on Market basket analysis to know more about confidence: