It's already being done, and apparently with very good results.
See: Predicting Risk of Suicide Attempts Over Time Through Machine Learning, Walsh, Ribiero, Franklin
Here is the abstract from the paper:
Traditional approaches to the prediction of suicide attempts have limited the accuracy and scale of risk detection for these dangerous behaviors. We sought to overcome these limitations by applying machine learning to electronic health records within a large medical database. Participants were 5,167 adult patients with a claim code for self-injury (i.e., ICD-9, E95x); expert review of records determined that 3,250 patients made a suicide attempt (i.e., cases), and 1,917 patients engaged in self-injury that was nonsuicidal, accidental, or nonverifiable (i.e., controls). We developed machine learning algorithms that accurately predicted future suicide attempts (AUC = 0.84, precision = 0.79, recall = 0.95, Brier score = 0.14). Moreover, accuracy improved from 720 days to 7 days before the suicide attempt, and predictor importance shifted across time. These findings represent a step toward accurate and scalable risk detection and provide insight into how suicide attempt risk shifts over time.
This has gotten national press attention quite recently. Here are a couple of prior articles on the result and endeavor:
Artificial Intelligence is Learning to Predict and Prevent Suicide (Wired)
Artificial intelligence can now predict suicide with remarkable accuracy (Quartz)
Is strongly suspect ML can be used in an array of application related to human mental health. For instance, it is entirely possible a app would be able to discern the mood swings in people with bipolar disorder based on activity or lack thereof.