Recognizing states of psychological vulnerability to suicidal behavior: a Bayesian network of artificial intelligence applied to a clinical sample

Background This study aimed to determine conditional dependence relationships of variables that contribute to psychological vulnerability associated with suicide risk. A Bayesian network (BN) was developed and applied to establish conditional dependence relationships among variables for each individual subject studied. These conditional dependencies represented the different states that patients could experience in relation to suicidal behavior (SB). The clinical sample included 650 mental health patients with mood and anxiety symptomatology. Results Mainly indicated that variables within the Bayesian network are part of each patient’s state of psychological vulnerability and have the potential to impact such states and that these variables coexist and are relatively stable over time. These results have enabled us to offer a tool to detect states of psychological vulnerability associated with suicide risk. Conclusion If we accept that suicidal behaviors (vulnerability, ideation, and suicidal attempts) exist in constant change and are unstable, we can investigate what individuals experience at specific moments to become better able to intervene in a timely manner to prevent such behaviors. Future testing of the tool developed in this study is needed, not only in specialized mental health environments but also in other environments with high rates of mental illness, such as primary healthcare facilities and educational institutions.

of 1132/100,000 during the first 3 months, which slowly declined depending on the follow-up period.
The risk decreased to 494/100,000 when follow-ups were between 1 and 5 years after discharge, to 366/100, 000 for follow-ups between 5 and 10 years after discharge, and to 277/100,000 for follow-ups 10 years or more after discharge. The authors noted that studies using data collected after 1995 show much higher suicide rates [9].
Another meta-analysis titled "50 Years of Research on Risk Factors and Suicidal Ideation" [12] concluded that "the ability to predict suicide has not improved in 50 years of research" (p.191). For a better understanding of SB, the authors suggested conducting follow-up studies, where findings should be combined in a complex and replicable way.
Our use of DM and AI tools is intended to complement the use of traditional statistics. This type of analysis adds utility when processing large volumes of data, which requires an understanding of complex phenomena. Such understanding is possible through observing unexpected relationships and conditional dependencies in the data and investigating beyond the hypotheses that may have been established a priori.
Other authors have used MD techniques to study the possible association of clinical and/or demographic variables with past or future suicidal behavior. This approach was used in several very relevant works carried out by different groups [3,22]. We take a different approach since we want to recognize which configuration of variables is most likely at the time of the risk of SB.
In fact, two studies published in 2017 that used machine learning techniques revealed the advantages of such techniques for studying SB ( [30]; C. G [39].). Overall, the evidence mentioned above has suggested that a paradigm shift is needed [15]. Such a shift can be achieved by studying populations in primary care facilities who are in states that precede SB [16]. Considering the fluctuating nature of SB, efforts to explore the uniqueness of each factor related to its preceding psychological conditions may be challenging.
We recognize the need to consider the simultaneous presence of variables as well as the existence of new factors in SB research. Within the category of "new factors, " we include groups of variables that operate simultaneously. In other words, a new factor might constitute a configuration of variables that emerge at a particular time [5,23,25]. While there is still a lack of reliable tools to predict suicide, certain factors that are predominant when a person attempts to end his or her life can be established [36,42]. Several researchers have studied mental states preceding SB by using different methodologies. Based on information provided by therapists, Hendin, Maltsberger, Haas, Szanto, and Rabinowicz (2004) compared reports of the affective states of patients who attempted suicide to those of control participants. The researchers suggested that "despair" was the most prevalent emotional state in participants who attempted suicide.
Tucker et al. [35] proposed the diagnostic entity "acute suicidal affective disturbance" (ASAD) to describe a common clinical condition among those exhibiting SB that can be deemed independent from their overall diagnoses. ASAD has been validated with the ASADI-L diagnostic instrument, which, according to the researchers, should be prospectively evaluated in individuals as well as through family studies. Galynker et al. [13] recently used the Suicidal Crisis Inventory (SCI) to study SB in a group of inpatients for four to 8 weeks. This scale has 49 items exploring five traditional factors: entrapment, panic-dissociation, ruminative flooding, fear of dying, and emotional pain. Among these factors, SB is mostly plausible based on higher indices for entrapment. Methods that have been tested to assess SB are complementary. Each method can be used to identify risks for subgroups of individuals with SB. For instance, the ASADI-L particularly emphasizes risk assessment in patients with prior suicidal intents, and the SCI evaluates emotional states preceding SB, as shown in the work carried out by Hendin.
We believe that several affective states may interact to place an individual in a state of vulnerability. Considering the complexity of the present task, we favored factor selection by means of a mathematical model. The predictive value of our model should be assessed in future studies by using a strategy similar to that used by Galynker et al. [13]. By focusing on the detailed study of clinical conditions that accompany SB, we also aimed to reveal the variables that can be modified to move patients away from a state characteristic of SB toward a state characteristic of individuals without SB. With this goal in mind, we used various data mining (DM) techniques, namely, support vector machine (SVM), decision tree (DT) and Bayesian network (BN), to specify unique relationships between variables contributing to the state of psychological vulnerability associated with SB.
Over the years, research has identified different risk factors for SB, among which psychiatric disorders, especially depressive disorders [43], and previous suicide attempts [4] have been deemed the most important. Along with depression, other mental disorders, such as schizophrenia, bipolar disorder, substance abuse disorder, eating disorder and borderline personality disorder, are highly present in individuals with suicidal behavior [43]. Likewise, alexithymia has been linked to an increased risk of suicide through the intensification of the propensity to develop depressive symptoms or the enhancement of psychological distress [10]. The literature has described a long list of risk factors in the social, family, biological and personality realms. Nevertheless, the purpose of this study is not to delve into the list of factors (see [43]) but to propose a way in which such risk factors can be analyzed with a novel technique to deepen our understanding of each factor's dynamic and individual presence.
We used the structure of the data from our first two DM experiments (SVM and DT) to explore the findings that emerged regarding the difference between protective and risk factors [5,25]. Subsequently, we delved deeper into the dependence relationships among the variables by using the Bayesian network technique [33]. This technique provided a perspective on the conditional dependence relationships among variables in individual cases. The findings of this in-depth study should be used to provide recommendations for clinical interventions. We acknowledge that suicide risk is highly individual and represents a critical manifestation of particular configurations of common factors. In other words, this study sheds light on the specificity of the subjective experience of psychological suffering by examining unique configurations of variables that differed from those already identified in the literature. Such configurations were deemed to be multidimensional, with each variable representing specific weights and interacting within conditional dependence relationships [19,41].

Main purpose
In light of the above, the purpose of this study was to deepen the understanding of the phenomenon of suicide through the study of psychological variables present in a clinical population that had presented suicidal ideation and suicidal behavior. We aimed to determine the relationships between variables and the existence of conditional dependency relationships 1 beyond the preliminary hypotheses. The study will allow clinicians to have a tool that is applicable to the particularities of each patient in psychotherapeutic interventions that address both the weaknesses and strengths of patients.
The findings are presented in the results section below.

Method
The preliminary hypothesis on which the study is based suggests that the more dysfunctional clinical variables that are present, the greater the psychological vulnerability to suicidal behavior.

Participants
The data analyzed here were drawn from responses from a clinical sample of patients with mood and anxiety symptomatology. Sampling was consecutive and purposive based on the availability of participants. Participants were either ambulatory or hospitalized patients from three mental healthcare centers serving three socioeconomic strata (high, medium and low) in Greater Santiago, Chile.

Inclusion criteria
The study included female and male participants who were available to participate in the study, who were able to distinguish between fantasy and reality, and who were in an emotional and cognitive state that enabled them to answer the assessment questions. Patients consulting for addiction, eating disorders, psychotic disorders or cognitive disorders were not included to control for the diagnosis variable, but it was recognized that these pathologies can be strongly linked to suicide risk [11,17,29]. In addition, data from patients who chose not to participate or who later withdrew from the study were not included. Participants were undergoing treatment as usual (TAU), which in the case of hospitalized patients consisted of crisis intervention with psychological, psychiatric, and occupational therapy approaches. For outpatients, treatment consisted of psychiatric and psychological approaches. This study was a cross-sectional evaluation of specific moments in participants' timelines.
Psychiatric diagnoses were made in collaboration with the treating teams according to the diagnostic criteria established in the Diagnostic and Statistical Manual of Mental Disorders, 4th Edition (DSM-IV-TR) [1].

Prior findings
Previous results from the same group of patients were used for the development of Bayesian networks [27]. SVM analysis provided variables that placed patients in either a risk or no risk condition. DT analyses showed possible configurations of combinations that could be located (depending on the route) in a state of risk or no risk. Such prior results were used to select relevant clinical and personality variables that either made individuals less likely to experience the psychological vulnerability associated with suicidal risk or placed them in such a state. These variables included psychological distress resulting in dysfunctionality, a dysfunctional experience, expression of aggression, factors that prevented suicidal behavior, destructive depressive experiences, and satisfaction with family functioning ( [24], 2015; Morales, Echávarri, [5,26,34]).
The characteristics of the analyses included in this study are detailed below: Support vector machine (SVM) model. 2 This technique was used to define whether a group was either at risk or not at risk by using supervised learning models linked to learning algorithms that analyzed and recognized patterns. The model generated 22 variables that, depending on the circumstances in which they occurred, defined whether a person belonged within a suicide risk configuration [5]. Decision tree (DT) model. 3 This technique was used to process and analyze large quantities of explicative variables. Based on the lowest Gini index [7] and given an appropriate and a sufficient number of questions, it was possible to identify four decision trees and a trajectory of psychological variables, which created a state of vulnerability to suicidal behavior [25]. The progression of these analyses is detailed in the Results section below, where we mention our prior work [5,25]. Sociodemographic and clinical information. Several descriptive variables were assessed: demographic, social, clinical, diagnostic, reasons for seeking treatment, and a description of the participant's behavior or suicidal ideation, when applicable. In the present study, we further identified conditional relationships among variables using the graphical model technique [2], specifically the Bayesian network technique [33].
A probabilistic graphical model is defined as a collection of graphs representing conditional probabilities between different variables. The Bayesian network is a type of probabilistic graphical model in which a defining graph fulfills certain specific properties (acyclic and directed).
Selected graph theory concepts are defined below: Graph: A collection of nodes or vertices as well as a collection of arcs (or edges) in which each arc connects nodes and is visually represented with lines that join nodes.
Directed graph: A graph where all the arcs are directed; that is, they have a starting node and an ending node and are represented by arrows on the arcs. Acyclic graph: A graph is acyclic if it is directed, and there are no sequences of arcs that start at one node and end at the same node. In other words, there is no "route" that leaves from and arrives at the same node. Node parent: Node A is considered a parent of node B if there is a directed edge from A to B. Node children: Node C is considered a child of node B if there is a directed edge from B to C.
A Bayesian network consists of the following: A network structure represented by a directed acyclic graph (DAG) where there is a collection of nodes, in which each node represents a random variable, and each edge represents a dependency relationship or correlation between variables. A probability distribution of parameters that can be deconstructed in a local probability distribution based on arcs found in the graph. Codes for conditional dependence relationships among the variables in its graph, revealing joint probability distributions expressed as factorizations of local probabilities, in which joint probabilities of all the variables can be calculated as the products of the probabilities of all the variables given their parent values.

Instruments
We developed a psychological evaluation instrument [5] available both online and offline. The instrument includes 25 questions to be answered on a Likert scale, and the answers are analyzed based on an algorithm defined by the Bayesian network model. The results identify whether a patient is in a state with SB characteristics. Then, each respondent is placed on a continuum of discomfort/well-being and fragility. This tool also considers risk factors and protective factors. The results from Barros et al. [5] identified areas of interest for particular psychotherapeutic interventions for each respondent: a) feelings of satisfaction/dissatisfaction with life; b) state of satisfaction/dissatisfaction with oneself and achievements; and c) reasons to live/stay alive if you are thinking about committing suicide. An example of the results is presented in the results section below.

Data collection
Potential participants were asked to sign a written informed consent form and were then asked to respond 2 Support vector machine models: Supervised learning models associated with learning algorithms that analyze data used for regression and classification analysis. Starting with a set of training examples, each marked as belonging to one or the other of two categories, an SVM training algorithm builds a model that assigns new examples to one category or the other, hence resolving a nonprobabilistic binary linear classifier [6]. 3 Decision tree technique: A model of computation in which an algorithm is considered to be a sequence of branching operations based on comparisons of some quantities, the comparisons being assigned the unit computational cost. The branching operations are called "queries or tests". The algorithm may be considered a computation of a Boolean function where the input is a series of queries and the output is a final decision, in which every query is dependent on previous queries or tests [7].
to the questions included in the following instruments: Outcome Questionnaire (OQ-45.2), State-Trait Anger Expression Inventory (STAXI-2), Reasons for Living Scale (RFL), Depressive Experience Questionnaire (DEQ), Family APGAR, and sociodemographic and clinical questionnaires. Detailed descriptions of these questionnaires can be found in Barros et al. [5] and Morales et al. [25]. Participants were guided through the questionnaires and written consent form by specially trained evaluators. If participants were minors, the consent form was signed in writing by their guardian or caregiver. The probability and protocol were approved by the institutional ethics committees of the School of Medicine at the Catholic University of Chile and the Sótero del Río Hospital.
The aims and methodology of the study were explained to participants, as well as the unpaid nature of their participation. Costs, risks of participating in the study, the voluntary nature of participation, the right to withdraw from the study, and confidentiality were also explained. Authorizations from treating physicians were also requested for patients' participation in the study, and any potential deterioration in the patients' mental states during the study was to be noted. No incidents were recorded during this study. Participants were also offered the opportunity to inquire further about the study by contacting the principal investigator. Health clinicians, researchers, and mathematical analysts collaborated in offering assistance to participants throughout the study.

Descriptive analysis of the data
Participants were categorized into the following two groups: 1) with suicidal behavior, as indicated by attendance of consultations regarding a suicide attempt or suicidal ideation within the preceding year (n = 326); 2) without suicidal behavior, as indicated by attendance of mental health consultations with no suicide attempt or signs of suicidal ideation within the preceding year (n = 324). The sample included 650 ambulatory mental health patients between the ages of 14 and 85 (adolescents, young adults, adults, and seniors) who were recruited between June 2010 and December 2014. Of this sample, 95.38% had been diagnosed with mood disorders (DSM IV-R). Among the total sample, the average age was 39.77 ± 15.03, with an age range between 14 and 83 years old. There were 517 women (79.54%) and 133 men (20.46%). Sociodemographic characteristics are detailed in Table 1.
The total sample was also mainly characterized by patients diagnosed with affective disorders, most commonly major depressive disorder (43.38%; n = 282), of whom 28.09% (n = 91) had not exhibited SB (attempt or ideation) during the past year, and 58.59% (n = 191) had attempted suicide. Of the 191 patients with SB who had been diagnosed with major depressive disorder, 26.18% (n = 50) made high-severity suicide attempts, 19.90% (n = 38) made low-severity suicide attempts, and 53.93% (n = 103) presented suicidal ideation. Low-severity suicide attempts were characterized by minimal intentions of dying, the low subjective or objective lethality of the attempt, and the deployment of efforts to be saved after the suicide attempt. On the other hand, high-severity suicide attempts were characterized by strong intentions to die as well as high subjective and objective lethality, with no efforts to be saved being made after the attempt. The psychiatric diagnoses are shown in Table 2.

Data analysis
Given the large number of variables currently available, it was necessary to perform a feature selection to narrow down what was to be modeled. This approach follows the principle of parsimony, indicating that if two models show the same performance, the model that has a smaller number of variables would be preferred. Consequently, considering previous work, we based the analysis of this study on two primary explorations using SVM and DT, as explained above. The software was R Project for Statistical Computer (R [31]).

Initial data processing
The results from the previous SVM analysis provided a model that selected 22 variables, which, depending on the circumstances, could define whether a person was in a suicide risk zone (accuracy = 0.78, sensitivity = 0.77, and specificity = 0.79). The assessment of all these variables allowed a determination of whether a patient was at risk of attempting suicide or was actively thinking of attempting suicide. Interrelationships between these variables were multiple and contributed to the particular ways in which variables were configured for each case. The metrics and analysis are presented in [5].
The results from the DT analysis showed the flow of responses as a trajectory of psychological variables that constituted a current situation of suicide risk (or no risk). Four trees distinguishing the groups were established, and the elements of one tree were analyzed in greater detail since they included both clinical and personality variables. This tree consisted of six nodes without suicide risk and eight nodes with suicide risk. Decision tree 01 had a 0.674 accuracy value, a 0.652  [25].
Taking the prior findings as inputs (i.e., the support vector machine and decision tree results mentioned above), we started with 25 variables. These variables were grouped and reprocessed into categories as follows: demographics were categorized as discrete values for classification, the Reasons for Living (RFL) questions were grouped into two variables, and question 25 of the Reasons For Living Questionnaire was kept separate because it was shown to be a relevant variable on its own, while the remaining questions were grouped as a single variable (due to strong correlations among them as seen in Fig. 1) by using the averages of their values; items from the Outcome Questionnaire (OQ) were grouped into a single variable (due to strong correlations among them) by using the averages of their values, except for question 8 from the Outcome Questionnaire, which was kept separate because of its relevance as a question on its own [18,37]. Figure 2 presents a matrix of correlations between the selected questions from the Outcome Questionnaire.  The Depressive Experience Questionnaire (DEQ) underwent a different preprocessing procedure. Correlations among the variables were weak (Fig. 3). Therefore, a principal component analysis (PCA) was performed with standardized variables [32], and the first two main components that explained 56.437% of the variance were chosen ( Table 4). The first main component, called "low self-esteem", included the being unable to accept personal plans and goals, having feelings of inner emptiness, becoming terrified when alone, having feelings of personal distress linked to success/failure, being concerned about what others can provide in relationships, and having feelings of dissatisfaction with oneself. This first component had higher coefficients associated with variables DEQ_16 and DEQ_19 and lower scores associated with variables DEQ_56 and DEQ_62, with negative  Fig. 1 The shows a matrix of correlations between the selected questions of the Reasons for Living Instrument. All the questions presented a high correlation. Query 25 is not in the correlation analysis because its importance suggests its use individually and not combined with the rest of the inquiries   00: Patients with low scores for main components 1 and 2 (high self-esteem and low interpersonal sensitivity); 01: Patients with a low score for main component 1 and a high score for main component 2 (high selfesteem and high interpersonal sensitivity); 10: Patients with a high score for main component 1 and a low score for main component 2 (low selfesteem and low interpersonal sensitivity); 11: Patients with high scores for main components 1 and 2 (low self-esteem and high interpersonal sensitivity) ( Table 5).
The coefficients of the DEQ variables for each of the two components are shown in Table 4 and Fig. 4. Feature transformation for the DEQ variables was necessary to narrow the scope of the problem. Regarding this questionnaire, the selected components rather than the  (fluctuating between feeling big and small).
DEQ_PRE_56 0.555 Agreeing with the statement "when I am involved with someone, I never feel jealous".
(not feeling jealous in relationships).
DEQ_PRE_62 0.262 Agreeing with the statement "I really need things that only other people can give me".
(needing things that only others can provide).
original variables were used to calibrate the Bayesian network model. With the new feature obtained from the DEQ variables, in the total sample, 24.3% (n = 158) of patients had high self-esteem and low interpersonal sensitivity, 24.3% (n = 158) of patients had high self-esteem and high interpersonal sensitivity, 26.3% (n = 171) of patients had low self-esteem and low interpersonal sensitivity, and 25,1% (n = 163) of patients had low self-esteem and high interpersonal sensitivity.
Meanwhile, participants in the group with SB had the following characteristics: 15.3% (n = 50) of patients had high self-esteem and low interpersonal sensitivity, 17.4% (n = 57) of patients had high self-esteem and high interpersonal sensitivity, 38.2% (n = 125) of patients had low self-esteem and low interpersonal sensitivity, and 29.1% (n = 95) of patients had low self-esteem and high interpersonal sensitivity.

Model calibration
The calibration of the model was achieved using crossvalidation. The process consists of two stages: 1) Learning the structure of the network. For the first stage, a mixed approach based on a) clinical expertise and knowledge and b) heuristics was used to learn the structure from the data. Based on clinical expertise and domain knowledge, an initial graph was defined regarding the relationships that we wanted to keep in the structure based on their clinical relevance. Additionally, a set of 'blacklisted' arcs were defined if the arcs that we did not want were part of the graph. This graph is shown in Fig. 5. Then, the structure of the final graph was completed by using a search algorithm, and several methods were tested in the calibration process (Grow-Shrink, Incremental Association, Fast Incremental Association, Interleaved Incremental Association, Hill-Climbing, Tabu search, and Max-min Parents and Children).
New relationships were formed according to the existing correlations in the data, which generated the Bayesian network seen in Fig. 6.
Subsequently, with the structure for each algorithm already in place, parameters associated with joint probability distributions were calibrated using the data and the Bayesian method for estimating parameters. Finally, the tabu search algorithm [28] was selected based on its lower average classification error and lower error classification variance over the crossvalidation process. The results of the search algorithm calibration are shown in Fig. 4b.

Evaluating model fit
As indicated above, the cross-validation technique was used to calibrate the structure and parameters. To determine the model fitness of the calibration process, the same technique was used, and the leave-one-out cross-validation method was also used to evaluate the final model. In both cases, we calculated precision and other relevant performance measures of the resulting model, and the details of each method are presented as follows.
1) The leave-one-out cross-validation method (LOOCV) was used, in which the model was trained with N-1 cases and its accuracy was calculated for Fig. 5 The figure presents the Initial graph with selected clinical and sociodemographic variables based on expert knowledge. The red node represents the response variable associated with suicidal risk the remaining cases (those that were not used for training). This procedure was repeated for each group of data, and the success average was equivalent to the precision estimator. With the LOOCV method, the Bayesian network model fit was 0.7046. The indicators are shown in Table 6.
2) Repeated 10-fold cross-validation was applied to calculate the model fit by repeating the process 100 times, which gave an average accuracy value of 0.701 (Fig. 7).
The results were used to develop a psychological evaluation questionnaire. This instrument has 25 items that are answered on a Likert scale. These questions can be asked by professionals in contact with individuals who are potentially at risk of attempting suicide. The person administering the questions need not be an expert but should be trained to ask the questions. Details of these questions can be seen in the Psychological Vulnerability Questionnaire shown in Table 7. The results identified whether the participant being evaluated was in a fragile state that made him or her vulnerable to actively thinking about suicide or attempting to commit suicide. As mentioned above, this assessment tool shows protective and risk factors for each patient, which might guide evaluators and clinicians toward indicating aspects of interest for psychotherapeutic intervention. A patient profile description was elaborated in terms of the following: a) Feelings of satisfaction/dissatisfaction with life. b) State of satisfaction/dissatisfaction with oneself and achievements. c) Reasons to live/to stay alive if one is thinking about attempting suicide.

Results
The raw results of the analysis, and later results including expert analysis, showed that there were categories that interacted to configure a state of vulnerability. These attributes differentiated the state stems from trait stems. In addition, some of the attributes were factors that had an impact on suicide risk, while others coexisted or appeared as symptoms (or vulnerability).
The following interrelationships between attributes were observed: 1) having an impact on vulnerability; 2) coexisting and being relatively stable over time; and 3) being part of the state of psychological vulnerability. The attributes that had an impact on state stems of vulnerability were sociodemographic in nature, such as gender, age, marital status, number of children or coinhabitants, level of schooling, occupation, and diagnosis. The attributes that coexisted, which were trait stems, were relatively stable and were associated with personality. These attributes were from the quadrant of selfcriticism/dependency depressive experience styles, as observed in personal descriptions with regards to the   Table 7 Psychological Vulnerability Questionnaire (PVQ) We request to answer the following questions in relation to: How have you been feeling in the last 7 days, including today: 6 DEQ 3 In general, I feel more satisfied with my plans and goals, than trying to achieve higher goals.  achieved. These attributes also included ascribing more or less importance to reasons for attempting suicide, such as thinking that one can adapt to problems or that only God has the right to end a life; not wanting to die; thinking that life is all that we have and is better than nothing; knowing that feeling bad will not last forever, no matter how bad it becomes; wanting to experience everything that life has to offer; loving oneself enough to stay alive; considering life to be too beautiful and precious to bring to an end; thinking that a solution can be found to any problem; feeling love for life; feeling too stable to kill oneself; hoping that things will get better and that the future will be happier; seeing no reason to hurry death; and considering the idea of suicide as totally incomprehensible. According to their joint probabilities, these variables supported the formation of a state of vulnerability, which were highly changeable and could be modified, such as feeling satisfied/ dissatisfied with oneself and with life, being interested in something, having thoughts about ending one's life, feeling like a happy person, and feeling content with oneself and with life. Details of these variables can be seen in the Psychological Vulnerability Questionnaire shown in Table 7. The use of this instrument provided specific recommendations for the evaluator, such as in the following example: for one participant, the answers provided placed the participant in the risk of suicidal behavior group with a probability of approximately 60%. In the presence of suicidal ideation, feelings of emptiness and dissatisfaction with oneself should be given special attention, and the expectations the patient has regarding interpersonal relationships and the presence of hopelessness should be evaluated.

Discussion
The general purpose of our work was to identify more accurately which clinical aspects of mood and anxiety disorders are most likely to be seen in a patient at risk of suicide. This can be considered a clinical study because we sought to establish a tool that recognizes risk based on a select group of variables, which may then be included in psychotherapeutic interventions. We recognize these findings to be part of a broader initiative to explore new methods and work strategies, whose applications and usefulness are just beginning to be known.
In this study, we established conditional dependence relationships between factors (transitory or stable) that were predominant in patients with suicidal ideation or who had recently attempted suicide. By systematizing variables with the Bayesian network method, we could visualize an image that showed directed graphs with the nodes and edges representing random variables in conditional dependency relationships or the correlations among them, which emerged within a time context. The relative values of each variable were defined by the algorithm that could assess whether a patient was or was not in a state of vulnerability. This method of organizing and selecting rich data could assist in recognizing relevant aspects of SB, which could be focused on in early interventions.
Our results could be compared to those yielded by traditional statistical methods with different metrics. However, the purpose of this study was not to make comparisons with other methods. Instead, we aimed to gain greater knowledge on how data mining can be used to understand suicidal behavior [8].
The results from analyzing Bayesian networks are considered to be measures used to adjust training data. Further studies to validate the instrument are necessary, which could allow us to obtain accuracy metrics of its predictive power in terms of precision, specificity, and sensitivity. New evaluations from hospitalized and outpatient participants should be considered for future studies validating the model.
The sequence of data mining analyses (SVM and DT) provided a fine-grained view of the data, which illuminated interrelationships that could configure vulnerability states. The use of the BN technique assisted in identifying individual treatment indications given the following conditional dependence relationships between attributes: having an impact on vulnerability, coexisting and being relatively stable over time, and being part of a state of psychological vulnerability. These conditional dependence relationships can be considered protective and risk factors, depending on the case at hand, and can be related to degrees of satisfaction with oneself, with others, and with life as well as the relative to values assigned to reasons for staying alive.
Our sample included patients with mood and anxiety symptomatology who were willing to participate in this study. We decided to restrict our sample to the most frequent group of patients in clinical practice. With the aim of extending its use to other diagnostic groups, our instrument should be tested on samples with greater diagnostic variety. The results reported here can contribute to better recognition of a mental state that might precede SB. Similar to targeting obesity, high blood pressure, and a sedentary lifestyle, which might decrease the risk of cardiovascular disorders, our study intended to identify factors that could be focused on in early interventions.
The items in the proposed instrument refer to patients' feelings toward themselves, life in general, and reasons for living, making the instrument suitable for use in a range of contexts aside from mental health institutions, such as educational environments or policing. With the use of this psychological evaluation questionnaire, it was possible to create a tool to assess general states of vulnerability and identify individuals who may be at risk of SB and who need to be directed to a specialist for further clinical assessment.
In addition, this instrument has a significant advantage over specific scales or questionnaires regarding suicidal ideation or behavior since it provides suggestions of areas for the patient to work on during psychotherapy in terms of the patient's psychologically strong and fragile aspects. Likewise, this model provides an advantage over traditional instruments, as traditional instruments may have adverse effects when used by poorly trained psychologists or psychiatrists (Arensman personal communication September 10th, 2017 NASP). Our work illuminated the use of traditional variables in a different way. As international research has suggested, this different approach could be considered the start of a new paradigm. Our overall aim was to contribute to public health with a new tool that aims at recognizing specific profiles of patients who might be in states of vulnerability. Interventions based on this tool could be adapted to specific characteristics found in each patient. This is a model that might be welcomed by those who support personalized interventions.
The process of evaluation and first intervention with this type of tool should broaden patients' perspectives by allowing them to explain the subjective logic behind their suicidal behavior and identify what affects them and what helps them in times of suicidal crisis. This type of tool could enable interventions to focus upon configurations of particular factors that can be enhanced or diminished in psychotherapy. Psychotherapeutic work could then focus on promoting emerging aspects such as current coping abilities, personal stability, the capacity to regulate emotions, feelings of personal competence, and feelings of satisfaction with oneself and with achievements. Such work could also serve to develop skills and areas of interest in life, to strengthen one's reasons to stay alive, and to reinforce support networks.
Likewise, this type of tool could allow patients to deepen their psychological elaborations of their feelings of disability, their capacity for emotional regulation and their dissatisfaction with oneself and with life. Furthermore, it may help in identifying and changing patterns of negative beliefs about oneself and others and mitigating traits of extreme dependence or extreme self-demand to alleviate despair and hopelessness.
Limitations of our findings should not be disregarded. As mentioned previously, our sample only included patients with major depression using DSM IV criteria. The diagnostic criteria for depression and anxiety in the DSM V contain modifications that we will have to include in the application of the results of our work.
Another limitation of this study is the exclusion of patients who had addictions, eating disorders, psychotic disorders or cognitive disorders. This decision was methodological, with the purpose of controlling the diagnostic variable in the detection of psychological vulnerability. It would be advisable for future research to include these pathologies in the study of psychological vulnerability to suicide.
The absence of data from those who decided not to participate and from those who, having initially accepted, later withdrew from the study, is another limitation of these findings.
Age needs to be examined more closely in further studies since our sample included patients above 14, and responses were similar across different age groups. Regarding the relationship between income and suicidal behavior, although there is evidence of an association between the two variables, this association needs to be explored further ( [20]; Knipe et al., 2015 [21];). The present study did not reveal differences relative to income and suicidal behavior since the sample included a relatively heterogeneous level of income. Finally, information that was not provided by individuals who chose not to participate in the study may have changed the results if it had been included.

Conclusion
As a recent review of the use of DM and AI to study SB showed, our work is consistent with the experience of many authors who supported the use of these techniques to study SB [8]. However, our interest in more precisely identifying the major factors associated with the mental state that precedes SB and their configuration is a new approach. This is an important methodological difference from the work cited in the mentioned review, as we have discussed in this manuscript. The usefulness of this new approach will need to be evaluated in subsequent studies.
While it is not possible to predict suicide risk today, we can more accurately explore the state of mind that patients experience closest to the time of suicidal behavior". The usefulness of our results must be evaluated prospectively. To do so, we must follow the evolution of behavior based on the variables that show these results.
We are already doing this in a sample of emergency services patients. We are currently following a sample of patients using several clinical instruments to evaluate the usefulness of our tool.
Our findings allow for the proposal of new goals for further studies. First, we need to evaluate the usefulness of this model in samples with broader diagnostic profiles (since these findings are applicable only to patients with mood disorders). We also believe that it is convenient to classify risk groups according to age and/or pathology to study whether the risk profile of SB has differences in these groups with respect to others. All of these steps are taken with the purpose of recognizing risk patterns that can be highly specific and personal.