{'fraction_non_alphanumeric': 0.03336675579322638, 'fraction_numerical': 0.017602495543672013, 'mean_word_length': 4.996325985303941, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Mathematical model for preoperative differential diagnosis for the parathyroid neoplasms

Background and objective Preoperative diagnosis of parathyroid carcinoma (PC) is critical for the determination of the scope of surgical intervention. Nowadays, specific diagnostic markers for differentiation of PC and benign tumors are unknown, and less than half of patients with PC undergo necessary en bloc surgery. The aim of this study was to develop the instrument for preoperative diagnosis of PC. Methods A multi-center retrospective study included 242 patients with primary hyperparathyroidism: 50 patients with PC, 30 with аtypical adenoma (AA), and 162 with adenoma of the parathyroid glands. Results Patients with PC and AA had higher levels of PTH, ionized and albumin-corrected calcium, ALP, volume and the largest diameter of neoplasm, and the higher frequency of GFR decrease less than 60 ml/min/1.73 m2 compared to patients with adenoma. The frequency of low-energy fractures was higher in the carcinoma group versus the adenoma group (32% vs 8%). Heterogeneous structure and indefinite contour of glands detected by US were more typical for PC than for AA and adenomas. The mathematical model was developed using CatBoost gradient boosting algorithm for the noninvasive preoperative differential diagnosis of PC, AA, and adenoma. Conclusions Model can predict adenoma with PPV 100% and PC with PPV 81–92%. Using model clinicians could plan extended en bloc resection for PC and selective parathyroidectomy for adenoma. If AA is predicted, he has to make a decision on the choice of the necessary volume of PTE based on his experience, because AA are the zone of uncertainty.


Introduction
Parathyroid carcinoma (PC) is a rare but aggressive and life-threatening cause of primary hyperparathyroidism (PHPT) and presents clinical challenges for timely diagnosis and management. The incidence of PC varies in different populations, from 1% of primary hyperparathyroidism (PHPT) patients in the United States and up to 5% of PHPT patients in Japan. PC accounts for only 0.005% of all cancers. 1,2 However, current reports from the European Union countries, the United States, and Finland indicate an increasing incidence of PC, which can be related to improvement in diagnostics or reflect an objective rise. According to the SEER (Surveillance, Epidemiology and End Results) observation over the 16-year study period, the incidence of PC grew by 60%. 2 The PC pathogenesis is currently poorly understood. It may rely on sporadic events or occur in the context of genetic syndromes such as hyperparathyroidism/jaw tumor syndrome (HPT-JT), multiple endocrine neoplasia type 1 (MEN1), type 2A (MEN2A), and familial isolated hyperparathyroidism (FIHP). 3 Most of PC cases are diagnosed postoperatively by histological examination due to the lack of preoperative criteria for differential diagnosis. In contrast to parathyroid adenomas (РА), which are effectively treated by selective parathyroidectomy (PTE), PC requires en bloc resection. Insufficient volume of surgery increases the risk of distant metastases that are extremely hard to treat. 4 Only 12.5%-48% of PC patients undergo an initial en bloc resection. 4,5 On the other hand, among patients with PA en bloc surgery is not needed but was performed in 2/162 (1%) cases, according to our previously published results. 5 Atypical adenomas (AA) represent an intermediate form of parathyroid neoplasms with uncertain malignant potential, suspicious clinical and histological features that represent a challenge for the differential diagnosis with PCs. No definite criteria exist to distinguish preoperatively AA from PA or carcinoma. The true incidence of AA is unknown, but in the largest series of patients undergoing surgery for PHPT, the prevalence varied from 0.5 to 4.4%. 6 The course of the disease and outcome (recurrence rate and overall survival) of patients with AA seems to be poorer than in patients with PA. Patients with AA showed higher incidence of symptomatic hypercalcemia and higher levels of iPTH more typical for PCs. 7 The optimal surgical approach remains unknown. In the group of AA, selective PTE was performed in 24/30 (80%) patients, en bloc resection-6/30 (20%), in our clinic.
Thus, the preoperative diagnosis of PC and AA is still challenging since the quality of medical care and the further prognosis of patients directly depend on this.
From 1990 to 2019, 74 patients with PC were diagnosed according to the registry of patients with PHPT in Russian Federation. At the same time, 22 cases were recorded in the first 19 years of the study, whereas most patients (n = 52) were registered in the last nine years (Fig. 1).
Potentially, a more personalized approach to the treatment of PHPT may improve outcomes and quality of patient's living.

Ethics
The study protocol was approved by the local ethical committee of the Endocrinology Research Centre (25.01.2017, No. 1).

Study design
Cases were retrieved from the Russian nationwide PHPT registry on January 15, 2020, when it included data on 3062 patients from 78 regions of Russia.
Inclusion criteria were: (1) histologically verified diagnosis of adenoma or AA or PC, and (2) availability of histological material for revalidation. Exclusion criterion was the absence of full data of anamnesis, instrumental, and laboratory data. So, 242 of 3062 cases met these criteria. Histological samples were independently re-validated by two experienced pathologists. 11 patients were then excluded due to disagreement of the pathologists' opinions. Finally, 242 patients were included in the study cohort: 50 patients with PС, 30 with AA, and 162 with parathyroid adenoma (PA).
The PTG volume was calculated using the ellipse formula: V (cm 3 ) = (A × B × C) × 0.49. Quantification of the bone state was carried out in the lumbar spine (L1-L4), proximal femur (neck thigh (Neck), total hip (Total)) and radius (ultradistal (RUD), middle third (R33%), and radius total (RT)) using dual-energy X-ray absorptiometry (DEXA). Bone mineral density (BMD) was assessed by T-score (in postmenopausal women and men older 50 years) or by Z-score (in premenopausal women and young men). Additional instrumental methods were carried out depending on the specific clinical situation. Histopathological types "adenoma", "atypical adenoma", "carcinoma" of the PTG were established according to the criteria of the WHO 2017. 8
Descriptive statistics of quantitative variables are presented by quartiles, and absolute and relative frequencies describe qualitative variables.
Comparison of two independent groups for quantitative data was performed using the Mann-Whitney test (U-test). Comparison of three independent groups for quantitative data was conducted using the Kruskal-Wallis ANOVA. The frequencies of binary variables were compared using the two-tailed Fisher exact test and Freeman-Halton test.
The critical level of statistical significance for statistical hypotheses testing was taken as 0.05. In multiple comparisons, the Bonferroni correction was applied by correcting the significance threshold.

Selection of features
We constructed two models for differential diagnostics between PTG neoplasm types. At the first step, we reduced the dimension of feature space using sklearn.feature_selection, module ExtraTreesClassifier and SelectFromModel. Then we constructed the first model to differ PA and (PC or AA). At the second step, we also reduced feature space and constructed the second model to differentiate PC and AA.
The Scikit-learn module's ExtraTreesClassifer and SelectFromModel classes were used to select features that are the most useful for prediction. The ExtraTreesClassifer class implements a meta estimator that employs averaging to control over-fitting by fitting a number of randomized decision trees (extra-trees) on different sub-samples of the dataset. 9 SelectFromModel class is a meta-transformer for selecting features based on importance weights. SelectFromModel accepts a threshold parameter and will select the features whose importance (defined by the coefficients) are above this threshold. SelectFromModel requires the underlying estimator to expose a coef_ attribute or a feature_importances_ attribute which in this case was provided by ExtraTreesClassifer class. The net results of the cooperation of these two classes are choosing the important predictive features among all predictive variables.

Data balancing
The ratio of patients with AA to those with PC and PA was ∼1:1.7:5.4. Therefore, the number of fault samples and the number of positive training samples were imbalanced, and the algorithm tended to ignore small classes and concentrate on the accurate classification of the large classes, resulting in a weaker model with limited predictive ability. To overcome the imbalanced nature of the data, we applied class weight balancing and balanced bagging methods in our training models. When class weight balancing methods are applied, if the sample size of a category is high, then it is assigned a low weight, and vice versa. 10 Balanced bagging, which involves bootstrapping or applying sampling techniques to the original data n times with replacements to create training sets, also improves a model's classification accuracy and reduces data imbalance. 11

Machine learning models
CatBoosting algorithm was conducted to construct mathematical models for the differential diagnosis of PTG neoplasm types. CatBoost is a gradient boosting framework that employs oblivious decision trees as base predictors; it is an open-source software library developed by Yandex. 12 For each level of each decision tree, decision rules containing feature indices and threshold values are collected, which eventually form a collection of disjoint subsets of feature vectors. The collections of feature vectors function as a prediction model. CatBoost reduces overfitting and improves the quality of a model. 13 Ten-fold cross-validation was used to validate models. Models with the best recall (sensitivity) and precision (positive-predictive value, PPV) values were chosen.

Clinical, laboratory, and ultrasound characteristics of the different PTG neoplasm types
Among 242 patients with PHPT, there were 213 women and 29 men aged from 13 to 80 years. Patients with PC were from 13 to 78 years old, with AA-from 18 to 75 years, with PA-from 15 to 80 years. Neoplasm groups differed by the level of PTH, ionized and albumincorrected calcium, ALP, volume and the largest diameter of neoplasm, the frequency of low-energy fractures, and the frequency of GFR decrease less than 60 ml/min/1.73 m 2 (Table 1). In post hoc comparisons of PC and PA, the same variables differed with p < 0.001. Besides, all factors except the frequency of low-energy fractures were significant for the differentiation of groups of patients with PA or AA.
Frequencies of the uneven contour and structure of formations significantly differed. In pairwise comparison, significant differences were found in the frequencies of changes in the structure and contour of the PTG neoplasm between the groups of PC and PA. Differential diagnosis was taken by two steps. At the first step, we performed differential diagnosis between PA and the united group of PC and AA. At the second step, we differentiated PC from AA. Thus, there are two sequential models.

Model #1
CatBoost model for differentiation of PA and (PC or AA) was developed. Ten predictors were sex; age at the time of the PHPT diagnosis; serum iPTH; serum ionized calcium; serum albumin-adjusted calcium; serum ALP; serum phosphorus; neoplasm volume; neoplasm diameter; and osteoporosis or low-energy fractures.

Model #2
CatBoost model for differentiation of AA from PC was developed. Eleven predictors were: sex; age at the time of the PHPT diagnosis; serum iPTH; serum ionized calcium; serum albumin-adjusted calcium; serum ALP; serum phosphorus; neoplasm volume; neoplasm diameter; CKD or nephrolithiasis; and osteoporosis or low-energy fractures.
Based on the best models, the confusion matrix was built (Table 2). Operational characteristics with 95% CIs were calculated according to this matrix.

Discussion
This study provides the first comprehensive nationwide analysis of patients with PC and AA in Russia. The main goal was to determine the preoperative clinical parameters of an increased risk of PC.
In our study, there were no significant differences in the laboratory and instrumental data between the groups of PC and AA.
PC was characterized by a more severe course of PHPT with significant complications in the kidneys (e.g., nephrolithiasis, renal dysfunction) and bone (e.g., decreased BMD). 14 According to our results, a decreased GFR less than 60 ml/min/1.73 m 2 was more common in patients with PC and AA than in patients with PA. The incidence of low-energy fractures was higher in the PC group than in the PA.
The multidimensional models for the preoperative differential diagnosis of PC, AA, and PA had benefits compared to previously proposed models. One of preoperative diagnostics of PC approach determines a low risk of PC whether calcium level is less than 3 mmol/L and neoplasm diameter is less than 3 cm ("The <3+ <3+ rule"). 15 However, this method does not consider the concentration of iPTH, a potentially crucial diagnostic indicator. Nonetheless, we applied "The <3+ <3+ rule" to our data. The confusion matrix was built (Table 3).
According to the WHO classification, AA is a separate group of parathyroid tumors. 8 There isn't an evidence-based preferable surgical approach. A clear management strategy for them hasn't been approved.
In addition, other differential diagnosis approaches were based on the iPTH and ultrasound signs. One method analyzed iPTH, the ratio between neoplasm diameters and the presence of invasive growth. The second one -the uneven contour of the carcinoma, invasive carcinoma growth, and the ratio between neoplasm diameters. 16 However, the parameters of these models have not been published, which made the comparison of the proposed model with those described earlier impossible. Unlike the existing ones, the novel approach considers demographic data, medical history, and clinical and instrumental examinations.
The models provide rather high accuracy of diagnosis. We compared the frequency of the right model diagnosis with frequency of the right diagnosis in routine clinical practice. As a criterion for right diagnosis in practice, we have taken the correspondence of the diagnosis to the volume of surgery, because, the necessary volume of surgery is chosen according to the expected histological diagnosis. Thus, we observe significant improvement of sensitivity of PC diagnosis as the model missed 1/50 PC case (2%, 95% CI 0%-11%) versus routine clinical practice that missed 26/50 PC cases (52%, 95% CI 37%-66%). 5 We suggest using this model because diagnosis of PC on preoperative stage is an important prognostic and predictive factor for relapse-free survival. 17 The model correctly diagnosed 154/162 adenomas cases (sensitivity 95%, 95% CI 91%-98%) versus routine clinical practice that correctly diagnosed 160/162 adenomas cases (99%, 95% CI 96%-100%). An extended operation in case of a false-positive diagnosis of PC does not affect the survival of patients and, when it is performed in a specialized center, should not lead to frequent postoperative complications. 18 Based on the calculations, clinicians could plan selective PTE in PA and extended en bloc resection in the case of PC. If the doctor received the AA prognosis, he has to make a decision on the choice of the necessary volume of PTE based on his experience, because AA are the zone of uncertainty. Despite the more severe clinical and biochemical profile as well as uncertain malignant potential of patients with AA compared to PA, most patients can be cured with selective PTE. The overall rate of recurrence of AA in sporadic cases is 2%. An overall survival up is to 93% after a follow-up of 5 and  20 The source code with instruction for calculations using two models is available at https://github.com/AlinaElfimova/Boosting-models-to-differ-PA-PC-and-AA.

Table 3
Confusion matrix after applying "The <3+ <3+ rule" to dataset (n = 242). 10 years and according to longitudinal retrospective studies all deaths were unrelated to the disease. However, the median follow-up for AA is rather short-47 (from 0.25 to 252) months. 6 Thus, at present, the required volume of surgery for AA has not been determined and remains at the surgeon's and endocrinologist's decision. In next steps, we plan to develop user-friendly software for the models described.

Limitations of the study
There is a retrospective study with the limitations inherent to the loss of data inserted to the Registry platform. In this multicenter study, the laboratory tests were performed in different laboratories, as well as instrumental examinations were performed by various specialists on different equipment. Histological preparations of the control group "adenomas" were reviewed by the one independent morphologist.

Conclusion
En bloc resection at the earliest possible time is the optimal treatment for patients with PC but the diagnosis of PC is now possible by the morphological examination, which is difficult to perform intraoperatively. Therefore, reliable preoperative predictor instrument was required. In our multicenter study, the set of two models was built to classify patients with PC, AA, and PA, and it's performance is better when compared with routine clinical practice. Thus, physicians will be able to plan the required volume of surgery according to the prediction of the models.

Funding
The study was supported by Ministry of Science and Higher Education of the Russian Federation (agreement no. 075-15-2020-899).

Declaration of Competing Interest
The authors declare no conflict of interest.