Conventional therapy options for chronic pain are still insufficient and patients most frequently request alternative medical treatments, such as medical cannabis. Although clinical evidence supports the use of cannabis for pain, very little is known about the efficacy, dosage, administration methods, or side effects of widely used and accessible cannabis products. A possible solution could be given by pharmacogenetics, with the identification of several polymorphic genes that may play a role in the pharmacodynamics and pharmacokinetics of cannabis. Based on these findings, data from patients treated with cannabis and genotyped for several candidate polymorphic genes (single-nucleotide polymorphism: SNP) were collected, integrated, and analyzed through a machine learning (ML) model to demonstrate that the reduction in pain intensity is closely related to gene polymorphisms. Starting from the patient’s data collected, the method supports the therapeutic process, avoiding ineffective results or the occurrence of side effects. Our findings suggest that ML prediction has the potential to positively influence clinical pharmacogenomics and facilitate the translation of a patient’s genomic profile into useful therapeutic knowledge.