Background Accumulating evidence suggests that non-genetic factors have important etiologic roles in amyotrophic lateral sclerosis (ALS), yet identification of specific culprit factors has been challenging. Many medications target biological pathways implicated in ALS pathogenesis, and screening large pharmacologic datasets for signals could greatly accelerate the identification of risk-modulating pharmacologic factors for ALS. Method We conducted a high-dimensional screening of patients’ history of medication use and ALS risk using an advanced machine learning approach based on gradient-boosted decision trees coupled with Bayesian model optimization and repeated data sampling. Clinical and medication dispensing data were obtained from a large Israeli health fund for 501 ALS cases and 4,998 matched controls using a lag period of 3 or 5 years prior to ALS diagnosis for ascertaining medication exposure. Results Of over 1,000 different medication classes, we identified 8 classes that were consistently associated with increased ALS risk across independently trained models, where most are indicated for control of symptoms implicated in ALS. Some suggestive protective effects were also observed, notably for vitamin E. Discussion Our results indicate that use of certain medications well before the typically recognized prodromal period was associated with ALS risk. This could result because these medications increase ALS risk or could indicate that ALS symptoms can manifest well before suggested prodromal periods. The results also provide further evidence that vitamin E may be a protective factor for ALS. Targeted studies should be performed to elucidate the possible pathophysiological mechanisms while providing insights for therapeutics design.