Background Parkinson's disease (PD) is a neurodegenerative disease, which has an upward progression. In advanced stages, motor symptoms cause functional impairment to patients due to the degeneration of the substantia nigra. In early stages of PD, there is a sensory impairment, and patients report visual processing dysfunction. There is still no cure for PD, and early diagnosis is essential to slow disease progression. New method Given the good anatomical representation and organization of the visual system in the cerebral cortex, in this study, we propose a biomarker of PD using EEG signals, photic stimulation, partial directed coherence (PDC) to perform feature extraction, and machine learning (ML) techniques. Our goal is to classify participants into three distinct groups: PD patients who are medicated; patients with PD and drug deprivation; and healthy subjects. Results We were able to achieve outstanding results, above 99% of accuracy and kappa statistic up to 0.98 using random forests and feature selection techniques. Comparison with existing methods: Our approach was evaluated using several ML methods. As features, we initially used the electrodes, without explicitly extracting feature vectors over signal samples. Conclusions The good results we obtained by using random forests made possible clinical applications for the early detection of PD and, consequently, better prognosis and patient's quality of life.