Suicide rates among recent veterans have led to interest in risk identification. Evidence of gender-and trauma-specific predictors of suicidal ideation necessitates the use of advanced computational methods capable of elucidating these important and complex associations. In this study, we used machine learning to examine gender-specific associations between predeployment and military factors, traumatic deployment experiences, and psychopathology and suicidal ideation (SI) in a national sample of veterans deployed during the Iraq and Afghanistan conflicts (n = 2,244). Classification, regression tree analyses, and random forests were used to identify associations with SI and determine their classification accuracy. Findings converged on several associations for men that included depression, posttraumatic stress disorder (PTSD), and somatic complaints. Sexual harassment during deployment emerged as a key factor that interacted with PTSD and depression and demonstrated a stronger association with SI among women. Classification accuracy for SI presence or absence was good based on the receiver operating characteristic area under the curve, men = .91, women = .92. The risk for SI was classifiable with good accuracy, with associations that varied by gender. The use of machine learning analyses allowed for the discovery of rich, nuanced results that should be replicated in other samples and may eventually be a basis for the development of gender-specific actuarial tools to assess SI risk among veterans.