Published on 11 October 2026

Analysis · Bipolar disorder · AI and psychiatry

Bipolar II to bipolar I: what does an algorithm built on the records of 1,890 Taiwanese patients actually predict?

▬ Publication Journal of Affective Disorders · 2026; 394: 120518 · Hsu et al. DOI 10.1016/j.jad.2025.120518 PMID 41138948 Scientific 65 Editorial 65
Editorial collections Tomorrow Psychiatry

The essentials

This retrospective cohort draws on Taiwan’s national health insurance data (the NHIRD database, which covers 99.99% of the population) for 1,890 adults aged 18 to 64 years in whom a psychiatrist had diagnosed bipolar II disorder at least twice, the first time between 2002 and 2012. During follow-up, which closed at the end of 2013, 274 of them (14%) received a diagnosis of bipolar I. The authors trained a machine learning model, XGBoost, on 80% of the cohort (1,512 patients), using 226 variables drawn from claims data: age, sex, visit frequency, new comorbidities, prescriptions before and after the diagnosis, family psychiatric history. In the 378 patients held out for testing, the area under the ROC curve was 0.91, sensitivity 77% and specificity 87%. The 86% accuracy is less impressive than it looks: with 14% converters, predicting « no conversion » for everyone would already give a figure of the same order. The predictor carrying the most weight in the model is an anticonvulsant prescription after the diagnosis (mean SHAP value 0.95). It is very probably a marker of severity, the trace of a doctor who saw the illness worsen and stepped up treatment, and nothing suggests that the drug tips anyone into bipolar I. Above all, what is recorded after the bipolar II diagnosis is recorded over the year preceding the bipolar I diagnosis (or the end of 2013 for non-converters): the model sees what happens just before the event it predicts. The other limitations are heavy: an ICD-9 code (296.89) that is not specific to bipolar II, a conversion that may be no more than a change of coding, as the authors acknowledge, no clinical rating scales, data from 2000 to 2013 and no validation in an external cohort. A research model. Not a clinical tool.

Context

A patient followed for bipolar II disorder may, years later, have a full manic episode. The diagnosis then becomes bipolar I, and management changes with it. Knowing in advance who is most likely to make that transition would help set the intensity of monitoring. The question has received little study, which is what makes this work interesting, even though it cannot answer the question for an individual patient.

Healthcare databases are also used to build broader risk models, such as the South London psychosis and bipolar model, which aims to predict psychosis and bipolar disorder together from the clinical record. Here the target is narrower: the shift from one subtype to the other.

XGBoost combines many decision trees built one after another, each correcting the errors of the one before. To see what the model relies on, the authors computed SHAP values, which split each prediction among the variables. A high SHAP value says that a variable weighs in what the model predicts. It does not say that changing that variable would change the patient’s course. The whole reading of the study rests on that difference.

The study at a glance

Item
Population
Adults aged 18 to 64 years with at least two diagnoses of bipolar II disorder (ICD-9-CM code 296.89) made by a psychiatrist between 2000 and 2013, the first (index date) between 2002 and 2012, identified in Taiwan’s national health insurance database (NHIRD, 99.99% of the population covered); exclusion of any history of schizophrenia spectrum disorder, bipolar disorder not otherwise specified or cyclothymia; 1,890 patients included out of 3,332 identified, of whom 274 converted to bipolar I (14%); follow-up to the end of 2013 or to the first bipolar I diagnosis, about four years on average
Model assessed
Supervised XGBoost learning model (100 trees with a maximum depth of 4, with class weighting), hyperparameters chosen by grid search on the area under the ROC curve; 226 variables: age at first bipolar II diagnosis (index date), sex, annual number of psychiatric visits and admissions, new medical and psychiatric comorbidities, psychotropic prescriptions by class, recorded over the year preceding the index date and over the year preceding the bipolar I diagnosis or the end of observation, family psychiatric history; variable importance estimated with SHAP values
Comparator
None: neither a simpler reference model nor a comparison with clinical judgment. Training on a random 80% of the cohort (1,512 patients), performance measured on the remaining 20% (378 patients), which the authors call an external test set although these patients come from the same database
Outcome
Conversion to bipolar I, defined by an ICD-9 diagnosis of bipolar I disorder (296.0, 296.1, 296.4, 296.5, 296.6, 296.7) at any point after the index date. Metrics: area under the ROC curve, accuracy, sensitivity, specificity; variable contributions by SHAP values
Design
National retrospective cohort on administrative health data, with a machine learning prediction model; internal validation on a test set randomly drawn from the same database, with no external validation cohort

Quality check

ItemVerdict
Data sourceNational database, near-complete coverage
FindingThe NHIRD rests on Taiwan’s universal health insurance and covers 99.99% of the population. Few patients escape capture, which limits selection bias at entry. The data are anonymised; the ethics committee of Chang Gung Memorial Hospital approved the study and waived consent.
Definition of bipolar IINon-specific code, partial safeguards
FindingICD-9-CM has no code of its own for bipolar II. The authors use code 296.89 (« other bipolar disorders »), which they describe as routinely used in Taiwan to denote bipolar II. They require at least two diagnoses made by a psychiatrist and exclude bipolar disorder not otherwise specified (296.80) and cyclothymia (301.13). Other forms of bipolar disorder may nonetheless remain in the cohort, in a proportion the data cannot estimate.
Definition of conversionPossible recoding, not necessarily progression
FindingConversion is the appearance of a bipolar I diagnosis; the publication does not say whether it had to be repeated, as the bipolar II diagnosis did. The authors acknowledge that some conversions may reflect diagnostic reclassification, for example delayed recognition of earlier manic episodes, rather than progression, and that their estimates probably combine the two. The share of each cannot be measured with claims data.
Clinical dataNo rating scales, prescriptions coded yes or no
FindingNo symptom scales, no description of episodes. Each psychotropic class is coded as used or not used over the period, without dosage, although the database contains doses. Educational level, socioeconomic status and other confounders are also missing, as the authors note. Prescriptions show what the doctor decided, not the actual severity, and practice has changed since 2000-2013.
Model validationInternal test only
FindingThe test set (378 patients) is randomly drawn and kept apart from training, which is correct. The authors call it an « external test set », but it comes from the same database, the same period and the same coding system: it is internal validation. No independent external cohort tests the model, and the authors themselves consider that the reported AUC may be overly optimistic.
Class imbalance14% converters
Finding274 converters out of 1,890. The authors weighted the classes during training, but with such an imbalance overall accuracy says little; sensitivity and positive predictive value become the figures to watch, and the latter is not reported.
Funding and conflicts of interestPublic and hospital funding, interests declared
FindingStudy funded by Taiwan’s National Science and Technology Council, with no role for the funder in the design; the first author is also supported by that council and by the Chang Gung Medical Foundation. E. Vieta declares grants or consulting, advisory or CME speaking activities for many pharmaceutical companies, public bodies and foundations. The other authors declare no financial interests or conflicts of interest. No product is being evaluated here, which limits what these links mean for the question asked.

Results

0.91
Area under the ROC curve of the XGBoost model for distinguishing patients who receive a bipolar I code from those who do not, in the internal test set of 378 patients. No validation in an external cohort.
ItemValue
Observed conversions274 of 1,890 (14%)
FindingBipolar I diagnosis during follow-up, which closed at the end of 2013, on average 1.3 ± 1.4 years after the bipolar II diagnosis in the development set and 1.2 ± 1.3 years in the test set. Some may reflect a revised diagnosis rather than a new manic episode, as the authors acknowledge.
Area under the ROC curve0.91
FindingInternal test set, 378 patients. Ability to rank a converter above a non-converter, within the same database and period as training. No confidence interval is reported, either for the AUC or for the other metrics.
Accuracy86%
FindingProportion of patients correctly classified. With 14% converters, a model announcing « no conversion » for everyone would already reach an accuracy of the same order.
Sensitivity77%
Finding23% of converters are missed by the model, roughly one in four.
Specificity87%
Finding13% of patients who do not convert are wrongly flagged as at risk.
Positive predictive valueNot reported
FindingThe publication reports neither positive nor negative predictive value, nor the number of converters in the test set. At this conversion rate, a specificity of 87% leaves many false positives relative to the number of true converters: a large share of flagged patients would not convert.
Main predictors (SHAP values)Anticonvulsants after the index date: 0.95
FindingMean absolute SHAP values; the publication details the 21 variables whose value reaches at least 0.07. Then, after the index date unless stated otherwise: annual number of visits, 0.56; « -pine » antipsychotics (quetiapine, olanzapine, clozapine, zotepine), 0.40; young age, 0.35; lithium, 0.30; SSRIs, 0.22; benzodiazepine-like hypnotics (Z-drugs), 0.19; annual number of visits before the index date, in an inverse relationship, 0.15; long-acting benzodiazepines, 0.15; SARI-type antidepressant (trazodone) before the index date, 0.12. Female sex ranks only sixteenth, 0.09. Also included, in an inverse relationship, are fewer new comorbidities after the index date (peptic ulcer disease, upper respiratory infections, anxiety disorders, liver disease, sleep disorders, from 0.10 to 0.07). Family psychiatric history is not among these 21 variables. These values measure the weight of each variable in the model’s predictions, not an effect on the risk of conversion.

Critical appraisal

ItemVerdict
Authors’ conclusionsLimitations discussed, conclusion more optimistic than the data
FindingThe authors themselves discuss several limitations: a possibly overly optimistic AUC, the absence of clinical scales, the share of reclassification among conversions, the need for external validation. They also present their explanations of the drug associations as mere hypotheses. But the abstract places the performance « in the external validation cohort », whereas this is a test set randomly drawn from the same database, and the conclusion speaks of « a robust data-driven framework for clinical risk stratification » and of support for early intervention, without any clinical benefit having been assessed. Added to this is the risk of an overreaching reading: a ranking of predictors mistaken for a list of causes.
Predictors and causalityAssociations, never causes
FindingSHAP importance ranks variables by their contribution to predictions. It says nothing about what would happen if the variable were changed in a patient. No predictor in this model can be read as a causal factor for conversion.
Treatments among the predictorsConfounding by indication very likely
FindingAnticonvulsants, antipsychotics, lithium: these prescriptions follow perceived severity. A doctor who sees symptoms of a manic kind emerging steps up treatment, and then the bipolar I code arrives. The authors themselves link the association of anticonvulsants and « -pine » antipsychotics to guidelines that make them first-line treatment for bipolar disorder, especially bipolar I, and that of lithium to augmentation reserved for certain patients. The model therefore learns the prescriber’s decision, and reverse causation is likely. The annual number of visits after diagnosis reads the same way: it reflects a more active illness and closer monitoring, hence more opportunities to recode the diagnosis.
Timing of the variablesWindow anchored on the bipolar I diagnosis
FindingVisits and comorbidities recorded after the index date are recorded over the year preceding the bipolar I diagnosis, or the end of observation on 31 December 2013 for non-converters; for prescriptions, the publication refers to the intervals so defined, without describing a separate window. When less than a year separates the two diagnoses, the number of visits is prorated to a twelve-month equivalent. In converters, the model therefore uses information gathered just before the event it predicts, and not what is known at the bipolar II diagnosis, the moment at which one would want to predict. Its performance on the day of diagnosis is not reported and would probably be lower. The windows also differ between the two groups: anchored on the event in converters, on a calendar date in the others.
Length of follow-upUnequal follow-up, binary classification
FindingThe index date runs from 2002 to 2012, which guarantees at least one year of follow-up, and mean follow-up is about four years. It stops at the end of 2013 for all non-converters: a patient diagnosed at the end of 2012 had one year in which to convert, a patient from 2002 much longer, and both count as non-converters if they did not. The publication describes neither a survival analysis nor any handling of this variable duration.
Metrics and imbalanceMisleading accuracy, imperfect sensitivity
Finding86% accuracy, of the same order as a uniform prediction of non-conversion would give; 23% of converters missed; positive predictive value not reported, although at this conversion rate false positives weigh heavily. The number of converters in the test set is not published: if the proportion matches the cohort’s, there are only a few dozen, and the estimates remain fragile, with no confidence interval to judge them by. Model calibration is not reported.
ComparatorNo clinical benchmark reported
FindingNo comparison is reported, either with clinician judgment or with a simpler model such as a logistic regression or a clinical score. We therefore do not know what the model adds to what a psychiatrist already picks up.
External validityTaiwan, 2000-2013, ICD-9
FindingA Taiwanese population, East Asian as the authors point out, its own insurance system, ICD-9 coding where other systems code in ICD-10 or ICD-11, prescribing practice more than ten years old, different prevalences. The model does not transfer as it stands to other healthcare systems.

Level of evidence

Scientific65/100
Editorial65/100

The level of evidence is that of a retrospective cohort (Oxford CEBM level 2b), on administrative health data. What is shown, within the limits of these data: in an internal test set, the model separates patients who receive a bipolar I code from those who do not, with an area under the curve of 0.91, using variables some of which are recorded just before that code. What is suggested: a profile associated with a higher risk of receiving that code, made up of young age, use of an anticonvulsant, a « -pine » antipsychotic or lithium after the diagnosis, more frequent visits after the diagnosis and, with much less weight, female sex. What remains hypothesis or opinion: that this model improves detection in the clinic, and any causal reading of its predictors.

Our view: the work rests on an exhaustive database and a standard learning procedure, but it predicts a code more than an illness, and it predicts it with information gathered just before that code. What the algorithm has learnt looks mostly like prescriber behaviour in the face of a worsening illness. That information is not worthless, and it matches clinical intuition. It does not make a tool. That would take a clinical definition of conversion, variables available on the day of diagnosis and validation in an external, recent population.

The colleague test

What an experienced colleague would say if you presented this study in two minutes, between two consultations.

« An AUC of 0.91 is flattering, but it rests on ICD-9 codes, an internal test and prescriptions recorded in the year before the bipolar I diagnosis. What the algorithm picks up first is that someone prescribed an anticonvulsant: it has learnt our prescriptions. I have no tool to use on Monday. I do keep one thing: a young bipolar II patient whose treatment I have to step up, I see more often and I look for mania. »

Translation for practice: stepping up treatment is itself a signal of severity, to be taken into account in follow-up; no model from this study replaces the clinical interview.

What you can do with this

  • What you can understand: a predictor in a machine learning model is an association. When that predictor is a treatment, it usually signals the severity that prompted the prescription (confounding by indication), not an effect of the drug.
  • What you can read in the figures: an AUC of 0.91 in an internal test; 86% accuracy, of the same order as a uniform prediction of non-conversion would give; 23% of converters missed; no positive predictive value published.
  • What you can monitor: in a young patient with bipolar II disorder whose treatment has to be stepped up with an anticonvulsant or an antipsychotic, look for full manic symptoms at every visit, and teach the patient and those close to them to spot the first signs. SSRIs also appear among the predictors; the authors raise a link with manic switch on antidepressants in bipolar depression, but present it themselves as a hypothesis, which this design cannot test.
  • What you should keep in mind if escalation involves an anticonvulsant: valproate belongs to this class, and the profiles the model links to conversion (young age, female sex) are those in whom its prescription is most restricted. Valproate exposure in utero carries a high risk of congenital malformations and neurodevelopmental disorders, which is why its use in girls and women of childbearing potential is tightly regulated; the rules themselves vary between jurisdictions. In France, for example, valproate should not be used in bipolar disorder in girls, adolescent girls and women of childbearing potential unless other treatments are ineffective or not tolerated; it is contraindicated in pregnant women, and in women of childbearing potential unless all the conditions of the pregnancy prevention programme are met, including effective contraception without interruption. Initial prescription is annual and restricted to certain specialists, and it requires an information acknowledgement form signed every year by the doctor and the patient (French summary of product characteristics for valproate semisodium, updated on 30 October 2025, and the French public medicines database, both consulted on 11 October 2026). Check the rules that apply in your own jurisdiction before prescribing. The choice of mood stabiliser also turns on other criteria, including suicide risk, covered in the analysis on lithium, valproate, antipsychotics and suicide risk.
  • What you can tell a worried patient: in this cohort, roughly one patient in seven received a bipolar I diagnosis during follow-up, and some of those changes may be down to coding. No calculation today can say, for a given person, whether that shift will happen. Regular follow-up, and a prompt appointment at the first signs of elation, are what make it possible to act early.

Frequently asked questions

Do anticonvulsants push patients towards bipolar I?

Nothing in this study allows that conclusion. An anticonvulsant prescription after diagnosis is the model’s most important predictor (mean SHAP value 0.95), but it is an association. The most likely explanation is confounding by indication: the doctor steps up treatment because the illness is worsening, and it is that worsening which precedes the bipolar I code.

What is a SHAP value, and why is it not a causal effect?

It is a way of splitting one of the model’s predictions among the variables that produced it. A high value means the variable weighs in what the model computes. It does not tell you what would happen if that variable were removed or added in a patient: that would take a trial, or at the very least a causal analysis designed for the question.

Is an AUC of 0.91 the mark of a good model?

It is good discrimination in an internal test set of 378 patients, drawn from the same database and period as the training data. It does not guarantee performance elsewhere, nor at the time of the bipolar II diagnosis, since some of the variables are recorded just before the bipolar I diagnosis. The other figures temper it: 86% accuracy, of the same order as a uniform prediction of non-conversion would give, 23% of converters missed, and no positive predictive value published.

Can this model be used in clinical practice?

No. It was built on ICD-9 codes and Taiwanese prescriptions from 2000 to 2013, without clinical scales, with variables partly recorded just before the bipolar I diagnosis, and has not been tested in an external cohort. What it offers the clinic is a reason for vigilance, not a score: a young bipolar II patient whose treatment has to be stepped up deserves closer monitoring.

Will my bipolar II disorder turn into bipolar I?

No one can predict that reliably for a given person. In this cohort, 14% of patients received a bipolar I diagnosis during follow-up, and some of those changes may reflect a revised diagnosis rather than a change in the illness. The most useful thing is to keep up regular follow-up and to seek help quickly in the face of an abnormally high mood, a reduced need for sleep or unusual agitation.

Annotated bibliography

Source study. Hsu C-W, Chen Y-CB, Wang L-J, Hung K-C, Chen M-H, Vieta E, Chen C-Y, Liang C-S, Carvalho AF. Uncovering predictors of bipolar II conversion to bipolar I: A machine learning analysis of national health records in Taiwan. Journal of Affective Disorders 2026; 394: 120518. DOI 10.1016/j.jad.2025.120518. PMID: 41138948. Published online on 23 October 2025. Funding: Taiwan National Science and Technology Council (grant 112-2314-B-182-070-MY3), with no role for the funder in the design of the study; C.-W. Hsu is also supported by the Taiwan National Science and Technology Council (109-2314-B-182A-009-MY2, 111-2314-B-182A-027-, 112-2314-B-182-070-MY3) and the Chang Gung Medical Foundation (CMRPG8P0631, CORPG8P0561, BMRPJ30). Protocol approved by the Institutional Review Board of Chang Gung Memorial Hospital (No. 202300262B0), with a waiver of consent; anonymised data. Conflicts of interest as declared: E. Vieta has received grants or served as a consultant, advisor or CME speaker for AB-Biotics, Abbott, AbbVie, Angelini, Biogen, Biohaven, Bristol-Myers Squibb, Celon, Compass, Dainippon Sumitomo Pharma, Farmindustria, Ferrer, Gedeon Richter, GH Research, Glaxo-Smith-Kline, HMNC, Idorsia, Janssen, Lundbeck, Medincell, Merck, Novartis, Orion, Otsuka, Pfizer, Roche, Rovi, Sanofi-Aventis, Sunovion, Takeda, Viatris, the Brain and Behavior Foundation, the Spanish Ministry of Science and Innovation (CIBERSAM), the EU Horizon 2020 programme and the Stanley Medical Research Institute; the other authors declare no financial interests or potential conflicts of interest. Retrospective cohort on Taiwan’s national health insurance database: it provides an XGBoost model that discriminates well, in an internal test, the patients recoded as bipolar I, and a list of predictors that mostly describe severity and prescribing decisions; it remains limited by a non-specific bipolar II code, a conversion defined by coding, variables recorded just before that coding, and the absence of clinical data and of external validation.

Editorial collections

Tags

Verified on 11 October 2026 against the full text of the publication and its supplementary material where available. This analysis underwent an independent double reading. The English version was checked for conformity on 11 October 2026, against the figures of the French version and against the source. How we verify what we publish

This analysis is intended for healthcare professionals. It does not constitute a prescribing recommendation and does not replace individual clinical judgment.

Analysis from Psychiatry Evidence Base, evidence-based psychiatry, explained with rigor.

Report an error in this analysis

Follow Dr Stroescu on LinkedIn, for the review every Saturday