Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# XGBoost model for electrocaloric temperature change prediction in ceramics

## Abstract

An eXtreme Gradient Boosting (XGBoost) machine learning model is built to predict the electrocaloric (EC) temperature change of a ceramic based on its composition (encoded by Magpie elemental properties), dielectric constant, Curie temperature, and characterization conditions. A dataset of 97 EC ceramics is assembled from the experimental literature. By sampling data from clusters in the feature space, the model can achieve a coefficient of determination of 0.77 and a root mean square error of 0.38 K for the test data. Feature analysis shows that the model captures known physics for effective EC materials. The Magpie features help the model to distinguish between materials, with the elemental electronegativities and ionic charges identified as key features. The model is applied to 66 ferroelectrics whose EC performance has not been characterized. Lead-free candidates with a predicted EC temperature change above 2 K at room temperature and 100 kV/cm are identified.

## Introduction

The electrocaloric (EC) effect is the coupled temperature and entropy change of a dielectric material due to the polarization change that results from the application or removal of an electric field1. Electrocaloric cooling offers great potential to build efficient solid-state cooling devices that are quiet, low weight, and compact, making it a promising replacement for noisy, less-efficient vapor compression systems and a candidate for on-chip cooling and wearable cooling devices2,3. With the potential to reach 60–70% of the Carnot coefficient of performance4, EC cooling devices are more efficient than thermoelectric devices5. The large electric fields required to operate EC cooling devices are easy to generate compared to the large magnetic fields required in magnetocaloric cooling devices6.

The EC temperature change (ΔTEC) is a function of material, characterization temperature, and applied electric field. Its magnitude is generally larger around phase transition temperatures and it increases with increasing applied electric field. The key to building an EC cooling device is to find a material with a large ΔTEC, which drives the heat flow, over a wide temperature range near the operating conditions, which are usually around room temperature. The EC effect was first observed in the Rochelle salt in 19307 and was intensively studied in the 1960s and 1970s in bulk materials. The resulting ΔTECs were not practically useful (below 1 K), however, and research interests waned. In 2006, the field was revitalized by the discovery of a large EC temperature change in a PbZr0.95Ti0.05O3 ceramic (12 K at a characterization condition of 499 K and 480 kV/cm)8. In 2008, the discovery of large EC temperature changes in PVDF-based polymers9 (over 12 K at 353 K and 2090 kV/cm for a P(VDF–TrFE) copolymer and at 328 K and 3070 kV/cm for a P(VDF-TrFE-CFE) terpolymer] suggested a path towards economical and environment-friendly fabrication and integration in flexible systems. Significant progress in EC materials development10,11,12 and EC device designs13,14,15,16 has been achieved since then. In 2013, Peng et al.17 reported a giant ΔTEC of 45 K in a Pb0.8Ba0.2ZrO3 thin film at 290 K and 598 kV/cm. In 2017, Ma et al.18 built a EC cooling device with a flexible P(VDF–TrFE–CFE) polymer and electrostatic actuation that produced a specific cooling power of 2.8 W/g and a coefficient of performance of 13.

Identifying an effective EC material is a non-trivial task. The synthesis of new EC materials relies on the instincts of experts and extensive experimental synthesis of ceramics, polymers, and/or composite materials. Effort has been devoted to theoretical understanding of the EC effect by conducting ab initio simulations19,20, classical simulations21,22, and phenomenological theory-based (i.e., Landau–Ginzburg–Devonshire type theory) studies23,24, but elucidating the physics of the EC effect remains challenging. One major reason is the complex nature of the EC effect, which involves polarization hysteresis, phase transition, sample crystallinity and crystallite size, and interactions between crystalline and amorphous regions1,3,25.

To aid the search for effective EC materials, we herein apply a data-driven approach to build a machine learning (ML) model to predict the ΔTEC for ceramics based on the material composition, dielectric constant, Curie temperature, and characterization conditions. While a large EC entropy change is equally important, we did not include it as a label because the isothermal entropy change can be directly calculated from the adiabatic temperature change, density, specific heat, and temperature1.

Machine learning is the field of study where computer programs learn some class of tasks and improve by performance measures from examples or experience26. The application of ML methods in materials science dates back to the 1990s27,28. Although ML methods were initially used as assistance tools for tasks such as spectral analysis29, biomolecule binding site prediction30, and the derivation of quantitative structure–activity relationships31, they have since become an essential part of the materials research portfolio32. Materials databases such as the Materials Project33, the Inorganic Crystallographic Structure Database (ICSD)34, Automatic Flow for Materials Discovery (AFLOW)35, and the Open Quantum Materials Database (OQMD)36 provide curated and reliable data that can be mined to identify the underlying physics of observed material properties and phenomena. Open access to ML packages and libraries (e.g., Scikit-learn37, PyTorch38, and Tensorflow39) facilitates the application of data-driven approaches to materials challenges.

Materials property prediction with data-driven methods typically uses the material compositions and/or basic material properties as input and the property (or properties) of interest as output. The learning problem is to find the best estimate of the property of a material not in the original dataset. The resulting well-trained ML model can reduce human effort that would otherwise be required to synthesize and characterize materials, accelerating the discovery of new materials and uncovering previously unknown correlations between properties32.

The application of ML methods in the field of materials science is extensive, and we provide four examples that are related to the current study. To support magnetocaloric refrigeration applications, Holleis et al. 40 built neural network, random forest, least absolute shrinkage and selection operator, and support vector regression models to predict the entropy change of single-molecule magnets (SMMs) at a magnetic field of 5 T. They assembled a dataset of more than 60 experimentally synthesized SMMs and designed 16 descriptors that described their structure, dimensionality, and chemical features. They identified four key descriptors that have the largest impact on the entropy change: number of d-ions, number of f-ions, molecular mass, and ideal spin per ion. Their ML models predicted three hypothetical SMMs for future synthesis.

Stanev et al. used random forest and neural network models to predict the critical temperature of superconducting materials41. The features were a combination of Materials Agnostic Platform for Informatics and Exploration (Magpie)42 features generated from the elemental composition of each material and AFLOW35 features based on crystallographic and electronic information. The tree-based model reached a coefficient of determination (R2 score) of 0.88 on the test data for critical temperatures >10 K. Their models offered insight into the mechanisms behind superconductivity in different families of materials and identified over 30 candidate materials from the ICSD. We will use tree-based models because of their interpretability and Magpie for feature generation due to its effectiveness in the absence of structural information43.

The dielectric constant, a property related to the EC effect, can also be predicted via ML methods. Mannodi-Kanakkithodi et al. used the kernel ridge regression model to predict the dielectric constant of polymers44. They represented the polymer structure based on its building blocks and trained the model on density functional (DFT) calculations. Their model showed moderate transferability and can predict the dielectric constant of 6-block and 8-block polymers after training on only 4-block polymer data. They also used a genetic algorithm to optimize the blocks in an evolutionary manner to design polymers with desired dielectric properties.

Su et al.45 recently developed support vector regression and random forest regression models to predict the ΔTEC of BaTiO3-based ceramics represented by chemical composition (i.e., elemental descriptors of the A-site and B-site elements), temperature, and applied electric field. Two separate regression-based ML models were developed for indirect and direct measurements. A classification model that predicts the expected phase as a function of chemical composition and temperature46 was introduced to complement the regression models. The combined regression and classification ML models are able to predict a global maximum in ΔTEC near the rhombohedral-to-cubic and tetragonal-to-cubic phase transitions.

Here, we build an eXtreme Gradient Boosting (XGBoost)47 model to predict the ΔTEC of a ceramic ferroelectric material given its composition, dielectric constant, Curie temperature, and characterization conditions. The dataset is assembled from available experimental ΔTEC measurements. We include the measurement method (i.e., direct or indirect) and polarization stage (i.e., polarization or depolarization) as categorical variables to better describe the data. The XGBoost model is able to predict ΔTEC with an R2 score of 0.90 and 0.77 on train and test data, corresponding to root-mean-square errors (RMSEs) of 0.38 K for both. The model correctly identifies the known physics that contribute to a large EC temperature change (i.e., applied electric field and the difference between the characterization and Curie temperatures). We apply the model to search for effective EC materials from 66 ferroelectrics whose EC performance has not been characterized and suggest candidate materials for future experimental verification.

## Results

### Materials dataset

There are three major categories of EC materials: polymers, ceramics, and polymer–ceramic composites. We built a dataset for EC ceramics due to their wide compositional variety. We extracted information from available literature as most of the material compositions do not appear in well-known materials databases 33,34,35,36. The dataset consists of 97 materials from 45 papers and is available at GitHub48 in a csv format. Snapshots from the dataset and a flow chart of the data gathering and model construction steps are shown in Fig. 1. More detailed information can be found in the “Methods—Materials dataset preparation” section and Supplementary Note 1.

We extract 7 features for each material: the material composition, temperature (T) and electric field (E) at which the ΔTEC is measured, the phase transition temperature (TCurie), the dielectric constant ϵ at T, and the measurement condition pol (for measurement during polarization or depolarization) and method (for direct or indirect measurements). We encode each material composition with the Magpie package42. Compared to direct encoding methods, encoding with Magpie keeps more chemical information from the materials by converting elemental chemical properties of the composition into 145 continuous or discrete numerical features. We then conducted feature selection by dropping features with zero variance, dropping features that have a Pearson correlation coefficient higher than 0.95 with an existing feature, and conducting a backward feature elimination process on these Magpie features. More detailed information on can be found in the “Methods—Feature selection” section and Supplementary Notes 2 and 3.

After these preprocessing steps, we have 4406 data points, each containing the 21 features listed in Table 1 (7 experimental condition/material property features and 14 Magpie features). The label to predict is the ΔTEC at the given conditions (i.e., T and E).

The collected data are plotted as a function of characterization temperature for the full scale in Fig. 2a. Data points with ΔTEC in the range of 0–2 K are plotted as a function of TTCurie in Fig. 2b. Different colors represent different material compositions and the marker sizes are proportional to the applied electric field. Most of these EC materials have a relatively small temperature change, with a median of 0.36 K and a mean of 1.07 K. Three of the 97 materials have a maximum ΔTEC > 30 K [Pb0.88La0.08Zr0.65Ti0.35O349, Pb0.8Ba0.2ZrO317, and Pb3Mg0.65Nb1.3Ti1.05O950], which far exceeds the next largest maximum value of 13 K. These three materials are marked as outliers and are excluded when building the model unless otherwise specified.

### Model performance

The XGBoost regression models (more details in the “Methods—XGBoost regression” section) for ΔTEC prediction are built with the best hyperparameter set from a grid search of 6912 combinations (Table 2). Given that XGBoost is unable to extrapolate and can only make reasonable predictions for situations previously encountered in the training history, the materials with the lowest and highest ΔTEC are forced to be in the training set, unless noted. These materials are PbZr0.95Ti0.05O38, whose maximum ΔTEC is above 12 K, and Bi0.5Na0.5TiO351, which has the largest negative ΔTEC. To examine the extrapolation capabilities, we forced PbZr0.95Ti0.05O3 to be in the test set and built three models, differentiated by their random seeds, whose results are presented in Supplementary Fig. 3. Although, as expected, the XGBoost models cannot predict a ΔTEC higher than the maximum seen in the training set [8.5 K of PbZr0.97La0.02(Zr0.95Ti0.05)O352], they all predict a ΔTEC high in their capability range for PbZr0.95Ti0.05O3. This observation demonstrates that the XGBoost models learned from the underlying physics and can be a useful tool for qualitative prediction and refining the search for new materials.

The 94 EC ceramics are split into train and test data sets based on their distance in the Magpie feature space53,54. The Magpie features of the EC materials are first projected onto a two-dimensional t-distributed stochastic neighbor embedding (t-SNE) space. A k-means clustering of the projection of the 94 materials was then conducted. An optimal k value of 3 was determined from the Elbow Method by plotting the within-cluster sum of squares as a function of k and identifying the “Elbow" as k. A cluster label is assigned to all data. From each cluster, 75% of the materials are picked as the training data and the remaining 25% are picked as the test data. Different numbers of features are used to build the models. We went from all 21 features in Table 1, to 20 features by removing the dielectric constant, to 7 features by removing all Magpie features, and to 6 features by removing the dielectric constant and all Magpie features. For each feature set, we trained 100 XGBoost models with the same hyperparameters but different random seeds and train/test splits. The R2 and RMSE results (mean and standard deviation) are summarized in Table 3, where the data in each of the rows corresponds to 100 models. The statistics of the model performance when training with the three outlier materials using different feature sets are provided in Supplementary Table 5. Box plots of the results are provided in Supplementary Fig. 4. The standard deviation is due to randomness in (i) the construction of the XGBoost model and (ii) splitting the materials into the training and testing sets.

In all cases, models trained without the outlier materials have significantly better performance in both the train and test scores. This observation suggests that there are features contributing to a large ΔTEC that are not included in our model. This point is further addressed in the “Discussion”.

Training with or without the dielectric constant gives a comparable performance. Models trained with all 21 features have a 0.01 lower R2 score and 0.01 K higher RMSE on the test set. When training on 7 features (i.e., the Magpie features removed), there is a large decrease in the test performance (−0.2 in R2 and +0.1 K in RMSE) and an increase in the standard deviations because XGBoost is losing all information about the material composition. Further removal of the dielectric constant (6 features remain) leads to a slight improvement (+0.04 in R2 and −0.02 K in RMSE) in the test performance compared to using 7 features. This improvement is because the model is introducing noise when imputing the missing dielectric constants without information from the Magpie features. In all cases, the standard deviations of the test sets are an order of magnitude higher than those of the training sets. The main contributor to the large standard deviations in the test sets is poor train/test splits where a large difference exits in the distributions of labels between these two groups. Even though all three outlier materials are removed and PbZr0.95Ti0.05O3 is placed in the training set when building models, there are other materials with larger ΔTECs than the majority of the data (e.g., 8.5 K in Pb0.97La0.02Zr0.95Ti0.05O352, 7.2 K in BaZr0.2Ti0.8O355, and 6.9 K in PbSc0.5Ta0.5O356) that may not be placed in the training set. In contrast, training and testing on the same split with 100 random seeds only leads to a standard deviation of 0.04 (0.03 K) in the R2 (RMSE) of the test set.

The parity plot for the predicted ΔTEC versus the experimental values for one of the high-performing models trained with the full 21 features is shown in Fig. 3. This model will also be used for feature analysis and predictions. For this model, the R2 (RMSE) scores for the train and test data are 0.90 (0.38 K) and 0.77 (0.38 K). In the high ΔTEC range (above 7 K), the model underpredicts ΔTEC due to the scarcity of materials that show a giant EC effect (3 out of 94 materials and 27 out of 4227 data points have ΔTEC > 7 K).

A test R2 value of 0.77 for a model without material microstructural information, as we have built, is comparable to results from previous studies where tree-based models were used for dielectric constant prediction. For example, Qin et al. 57 trained five commonly used ML models with 32 intrinsic chemical, structural, and thermodynamic features to predict the dielectric constants of ceramics. They gathered 254 single-phase materials from the experimental literature and their random forest model achieved an R2 score of 0.76 on the test set. Takahashi et al. 58 built random forest models to predict the electronic and ionic contributions to the static dielectric constant. Their dataset consisted of approximately 1200 metal oxides from density functional perturbation theory calculations. The introduction of structural descriptors to the original compositional descriptors improved the model performance. The test R2 score increased from 0.87 to 0.89 for the electronic contribution and from 0.65 to 0.73 for the ionic contribution.

### Feature analysis

We conducted feature analysis on the XGBoost ΔTEC model whose parity plot is shown in Fig. 3. The impurity-based feature importance is calculated by XGBoost by measuring the total gain (i.e., improvement in accuracy) across all splits where the feature is used. The higher the feature importance value, the more important that feature is. Impurity-based feature analysis tends to favor features with high cardinality (i.e., more unique values). As such, permutation-based feature importance, which measures the decrease of the model score when the values in a single feature are randomly shuffled, is also reported in Supplementary Fig. 5. In both methods, the six most important features are the same.

The impurity-based feature importance is presented in Fig. 4. The applied electric field E ranks first, followed by T − TCurie. These observations are in agreement with the known physics: ΔTEC of an EC material increases with the applied electric field (before electrical breakdown) and is usually the largest around its Curie temperature as the material goes through a phase transition. We further analyzed the features by setting E = 100 kV/cm and T = TCurie for ΔTEC predictions, thus ruling out their influence, and then calculating the Pearson correlation coefficient of the remaining features with the predicted ΔTEC. As shown in the color map in Fig. 4, the predicted ΔTEC shows mildly positive correlations to T (Pearson correlation coefficient of 0.28) and ϵ (Pearson correlation coefficient of 0.42). A Pearson correlation coefficient heat map among all features is reported in Supplementary Fig. 6.

The 16 Magpie features synergistically help the model distinguish between different materials. As such, the direct interpretation of an individual feature can be difficult. The predicted ΔTEC shows moderately positive correlations to mean_Row (Pearson correlation coefficient of 0.50) after ruling out the influence of E and TTCurie. This result is consistent with the observation that the ceramics in our dataset with a negative EC effect usually contain sodium, while 9 of the top 10 materials with largest experimental ΔTEC contain lead.

maxdiff_MendeleevNumber is ranked as the most important Magpie feature in Fig. 4. Recall that in the feature selection, we dropped Magpie features with a Pearson correlation coefficient >0.95 with existing features. In this case, MaxIonicChar, maxdiff_Electronegativity, and min_Electronegativity show a Pearson correlation coefficient of 0.96, 0.96, and −0.96 with maxdiff_MendeleevNumber. It is interesting that this set of four features is picked up by the XGBoost model among all 145 Magpie features (or 110 features of non-zero variance). As shown in Fig. 4, the predicted ΔTEC has a moderately negative correlation to maxdiff_MendeleevNumber (−0.45). This feature set could be related to the electronic and ionic polarization in EC ceramics, but microstructural information (e.g., phases and grain size) for these materials is required before making firm conclusions.

Although the measurement condition pol is ranked as the third highest in the impurity-based feature importance, it is ranked fifth in the permutation-based feature importance. The model tends to predict a 0.3 K higher ΔTEC if pol indicates polarization instead of depolarization. The measurement method does not stand out, as might have been expected. We also note that the differences in the measured ΔTEC from pol and method in literature are generally below 0.2 K, smaller than the model RMSE (0.38 K).

The observed low impurity- and/or permutation-based importance of some Magpie features (e.g., maxdiff_NdUnfilled, mean_GSbandgap, and min_number) suggest that they can be removed. Given that our XGBoost model is rigorously regularized (i.e., with tree pruning and restrictions in the splitting of nodes), the model is not sensitive to the inclusion of less relevant features.

### Prediction on ferroelectric materials

We now examine the predicted ΔTEC for 66 ferroelectric ceramics whose EC performance has not been reported. We use the XGBoost ΔTEC model whose parity plot is shown in Fig. 3 for the predictions. The electric field is set to 100 kV/cm. The features for the characterization conditions are set as direct measurement (method) and polarization (pol). The predicted ΔTEC as a function of temperature (for the temperatures at which the dielectric constant is reported) are plotted in Fig. 5a for the 66 ferroelectric ceramics and in Fig. 5b for the original EC dataset. To simplify the plots, we grouped materials into families based on compositional similarities. For example, (1−x)PbMg1/3Nb2/3O3−xPbTiO3 is denoted as PMN-PT and BaZrxTi1−xO3 is denoted as BZT. A full list of material compositions with their family group is provided in a separate csv file48, as described in Supplementary Note 1.

For the ferroelectric ceramics from the non-EC literature, PbZr0.57Ti0.43O3 has the highest predicted ΔTEC of 3.6 K at 100 kV/cm and 600 K. The EC material PbZr0.3Ti0.7O359 exhibits the largest ΔTEC of 4.1 K at 100 kV/cm and 753 K. We identify good candidates in Table 4: Pb0.89La0.11Zr0.68075Ti0.29175O360 is predicted to have a ΔTEC of 2.9 K at 328 K and the lead-free Ba0.91Ca0.09Ti0.86Zr0.14O361 is predicted to have a ΔTEC of 2.6 K at 318 K.

Although no material from the non-EC literature exceeds the performance of the state-of-the art EC materials, the top lead-free candidates in Table 4 are worth exploring. By adding new measurements of promising materials to the existing dataset, active learning techniques can be used to iteratively train new models and search for promising materials53. Active learning approaches, such as Bayes’ theorem on materials discovery62 and uncertainty-driven active learning for neural network potential development63, have demonstrated success in reducing experimental trials and/or computational cost.

## Discussion

The predictive ability of our XGBoost model demonstrates that a physics-informed data-driven approach is a promising avenue to studying EC materials. Moving forward, an organized database dedicated for ferroelectrics and/or EC materials would be useful to the community. To further improve the model’s predictive capability and ability to elucidate underlying physical meaning, more detailed information on the EC materials is required. Many of the factors that influence ΔTEC, such as sample size, morphology, and crystallinity, are not reported in the literature and are therefore not accessible to our model. Representative examples are provided below.

Going from a thick film to a thin film leads to an increased ΔTEC at a moderate voltage3,25 and at the same time changes the dielectric properties of a material. For example, the maximum dielectric constant in Pb0.8Ba0.2ZrO3 is around 12,000 in a sintered bulk sample64 while it has a value of 1200 in a 320 nm thin film17. Gao et al.65 demonstrated the effect of film thickness with antiferroelectric Pb0.82Ba0.08La0.10(Zr0.90Ti0.10)O3 (PBLZT) thick films. ΔTEC values of 25.1, 19.8, and 13.9 K were measured for film thicknesses of 1.0, 1.5, and 2.0 mm at 700 kV/cm and room temperature. They attributed the decrease of ΔTEC as film thickness increases to the reduction of the preferred orientation. The PBLZT thick films changed from a $$\left\langle 100\right\rangle$$-preferred orientation to random orientation with increased film thickness.

Phase coexistence can contribute to a large ΔTEC and many EC ceramics are synthesized with compositions from the morphotropic phase boundary17,50,66. For example, thin film Pb0.8Ba0.2ZrO3 has a giant ΔTEC of 45 K at room temperature as it goes through an electric field-induced transition from an orthorhombic antiferroelectric phase to a rhombohedral ferroelectric phase17. The large entropy change from random nanoregions to ordered nanoregions in thin film Pb0.8Ba0.2ZrO3 under an electric field may also contribute to the giant EC effect17.

Crystal orientation and phase can lead to a different polarization response and hence a different ΔTEC50,67,68,69,70. Luo et al.68 found the maximum ΔTEC for $$\left\langle 111\right\rangle$$- and $$\left\langle 001\right\rangle$$-oriented 0.71PbMg1/3Nb2/3O3-0.29PbTiO3 single crystals to be 2.0 and 2.3 K at 50 kV/cm. Bai et al.66 demonstrated with (1−x)PbMg1/3Nb2/3O3−xPbTiO3 (x = 0.3–0.35) that the tetragonal-cubic phase transition induced a much larger ΔTEC (0.69 K) than the rhombohedral-cubic and rhombohedral-tetragonal transitions. The tetragonal phase has the largest polarization vector and the complete disappearance of dipoles in the cubic phase induces a much larger polarization change than their rearrangement in the rhombohedral phase. A difference of 0.4 K in ΔTEC is also observed among their $$\left\langle 001\right\rangle$$, $$\left\langle 110\right\rangle$$, and $$\left\langle 111\right\rangle$$ crystals.

High crystallinity, a smaller grain size, and isometric grain shape are beneficial to the EC performance25,71. By introducing Pr to SrBi2(Nb0.2Ta0.2)2O9, Axelsson et al.71 synthesized dense samples with no secondary phase. The highly isometric grain shape of the Aurivillius phases in combination with a small grain size increased the grain boundary density, leading to an increase in the dielectric strength. The dopant Pr3+ without lone pair electrons also leads to a diffuse relaxor-ferroelectric phase transition and shifted the phase transition temperature to a lower value. Other factors such as the substrate material and orientation, as well as the sample growth temperature can also influence ΔTEC by introducing clamping, misfit strain, and/or thermal stresses72. The order of the phase transition in an EC material impacts the shape of ΔTEC versus T and is also worth considering3.

Enforcing physical laws in ML models (e.g., tailoring neural network architectures, designing kernel-based regression models, encoding simple symmetries, or choosing appropriate loss functions) provides another avenue for fast and accurate training and improved generalization ability73. In the field of EC cooling, ML architectures that associate ΔTEC with the polarization at a given E and T, or that incorporate mathematical constraints from the Maxwell relations are potential approaches. Parallel efforts for EC polymers would also be of great interest.

## Methods

### Materials dataset preparation

We collected 97 materials from 45 papers. For each of these materials, we extracted ΔTEC at different characterization temperatures T and applied electric fields E and then included these quantities as features for the predictive model. As another feature, we extracted the dielectric constant ϵ at different temperatures (and at the lowest reported frequency if measured at multiple frequencies) and conducted linear interpolation to obtain values at the temperatures where the ΔTEC is measured. 34 of the 97 materials do not have a dielectric constant reported with their ΔTEC. We used the built-in algorithm from the XGBoost47 model to handle the missing values. The phase transition (e.g., ferroelectric to paraelectric) temperature is recorded as the feature TCurie. When the Curie temperature or phase transition temperature is not explicitly reported, we extracted the temperature where the peak of ΔTEC occurs as TCurie. A precalculated feature TTCurie is also included. The categorical feature method is used to denote how ΔTEC is measured. The direct measurement (where ΔTEC is measured directly using thermometers or by recording the heat flow using calorimeters3) and the indirect measurement (where ΔTEC is obtained from polarization change via the Maxwell relations1,74) may provide different values and/or trends for ΔTEC for the same material and conditions55,71,75,76,77. The categorical feature pol records whether ΔTEC is measured in the polarization or depolarization stage. Due to small losses associated with the polarization hysteresis and Joule heating, the measured EC temperature increase in polarization can be ~0.2 K larger than the EC temperature decrease in depolarization76,77. Although the phenomenon of the EC effect should be nominally reversible and independent of measurement conditions78, we use pol and method to help distinguish the source of the experimentally measured ΔTEC.

Each of the 97 materials has a different number of entries in the dataset based on how many electric fields and/or temperatures they were measured at. We trimmed data points when a material had over 100 entries, as these ΔTECs are recorded at small electric field and/or temperature intervals.

Three of the 97 materials are marked as outliers: Pb0.88La0.08Zr0.65Ti0.35O349, Pb0.8Ba0.2ZrO317, and Pb3Mg0.65Nb1.3Ti1.05O950. These materials have a giant EC effect, with a maximum ΔTEC above 30 K, while the maximum ΔTEC of the rest of the materials does not exceed 13 K. There may be microstructural effects contributing to the giant EC effect in these three outlier materials that cannot be captured by the descriptors generated from material compositions and commonly reported properties. Bi0.5Na0.5TiO3 (BNT)51 has the smallest ΔTEC of −1.6 K. A negative ΔTEC is known as the negative EC effect, where the isofield polarization of a material increases with increasing temperature (e.g., an antiferroelectric–ferroelectric transition with increasing temperature)78. In total, 16 materials have one or more data points where ΔTEC is smaller than zero. Of these, the magnitude of ΔTEC is <0.5 K except for three BNT-based materials.

### Feature selection

Each material composition was converted into 145 features with the Magpie package42. The Magpie features are obtained using the minimum, maximum, and mean of elemental chemical properties and their positions in the periodic table. Given the large quantity of generated features, not all are relevant in our study. We conducted feature selection to remove redundant features, which could add noise to the model. First, we removed Magpie features that have zero variance in our dataset, which leads to 111 remaining Magpie features. For example, as all the collected EC ceramics contain oxygen, the minimum atomic weight and the minimum melting temperature of the individual elements have the same value. We then reduced the feature collinearity by dropping features that have a Pearson correlation coefficient higher than 0.95 with an existing feature, leading to 38 Magpie features (listed in Supplementary Table 1). A list of features dropped due to a large Pearson correlation coefficient with existing features is listed in Supplementary Table 2. The choice of the feature to keep from a set of highly correlated features has a negligible influence on the model performance (see Supplementary Fig. 1 and Supplementary Table 3).

Next, we conducted a backward feature elimination process on these Magpie features. The three outlier points with giant ΔTEC are temporarily removed in this step to avoid high variance in the cross-validation R2 score. We started with 45 features (38 Magpie features plus 7 features extracted from literature), computed the performance of the XGBoost model after eliminating each Magpie feature, and then removed the least-significant feature until no improvement was observed. 14 Magpie features (feature IDs 8–21 in Table 1) remained after this process. The number of features kept versus the cross-validation R2 score is plotted in Supplementary Fig. 2. The order of features being dropped in this process is listed in Supplementary Table 4.

### XGBoost regression

XGBoost47 is an open-source library with an efficient and scalable implementation of the gradient boosting framework79. Gradient boosting minimizes the prediction error with a gradient descent algorithm and produces a model in the form of a set of weak prediction models (decision trees in this case). During the training, gradient boosting adds new regression trees one at a time to reduce the residual (i.e., the difference between the model predictions and the label values). Existing trees in the model remain untouched, which slows down the rate of overfitting. The output of the new tree is combined with the output of existing trees until the loss is minimized below a threshold or the specified limit of trees (e.g., maximum depth) is reached. After the trees are built, XGBoost can apply tree pruning, where the size of the trees is reduced by pruning nodes from bottom (leaves) to top (root) if the loss reduction of having that node is smaller than the regularization parameter gamma.

We applied XGBoost with the Scikit-learn package37. The hyperparameters were tuned with a grid search using training data. A five-fold cross-validation resampling technique was used. When examining each hyperparameter set, the training data was randomly split into five groups of approximately equal size. Four groups of the data were used for the training set and the remaining group was used as the validation set. This procedure was repeated five times, leading to five validation R2 scores for each hyperparameter set. The set with the highest averaged validation R2 score was selected.

The dielectric constant is a relevant property for the EC performance of a material. A linear interpolation of the dielectric constant at the temperatures where ΔTEC was measured provided data for 63 of the materials in the dataset. The missing dielectric constant values in the other 34 materials were handled by the default built-in method in the XGBoost algorithm47. Essentially, each of the decision nodes in XGBoost has a default direction, such that when a missing value is encountered during splitting in the tree branch, the instance is classified in that default direction.

## Data availability

The data used to train and test the machine learning models are available at https://github.com/Jie0705/MachieneLearning-EC-Dataset.git.

## Code availability

All codes from this study are available from the corresponding author upon reasonable request.

## References

1. Lines, M. E. & Glass, A. M. Principles and Applications of Ferroelectrics and Related Materials (Oxford University Press, 1977).

2. Scott, J. F. Applications of modern ferroelectrics. Science 315, 954–959 (2007).

3. Scott, J. F. Electrocaloric materials. Annu. Rev. Mater. Res. 41, 229–240 (2011).

4. Correia, T. & Zhang, Q. Electrocaloric Materials (Springer, 2014).

5. Zhao, D. & Tan, G. A review of thermoelectric cooling: materials, modeling and applications. Appl. Therm. Eng. 66, 15–24 (2014).

6. Gómez, J. R., Garcia, R. F., Catoira, A. D. M. & Gómez, M. R. Magnetocaloric effect: a review of the thermodynamic cycles in magnetic refrigeration. Renew. Sust. Energ. Rev. 17, 74–82 (2013).

7. Kobeko, P. & Kurtschatov, J. Dielektrische eigenschaften der seignettesalzkristalle. Z. Phys. 66, 192–205 (1930).

8. Mischenko, A. S., Zhang, Q., Scott, J. F., Whatmore, R. W. & Mathur, N. D. Giant electrocaloric effect in thin-film PbZr0.9Ti0.05O3. Science 311, 1270–1271 (2006).

9. Neese, B. et al. Large electrocaloric effect in ferroelectric polymers near room temperature. Science 321, 821–823 (2008).

10. Li, Q. et al. Relaxor ferroelectric-based electrocaloric polymer nanocomposites with a broad operating temperature range and high cooling energy. Adv. Mater. 27, 2236–2241 (2015).

11. Zhang, G. et al. Nanoconfinement-induced giant electrocaloric effect in ferroelectric polymer nanowire array integrated with aluminum oxide membrane to exhibit record cooling power density. Adv. Mater. 31, 1806642 (2019).

12. Chen, Y. et al. An all-scale hierarchical architecture induces colossal room-temperature electrocaloric effect at ultralow electric field in polymer nanocomposites. Adv. Mater. 32, 1907927 (2020).

13. Epstein, R. I. & Malloy, K. J. Electrocaloric devices based on thin-film heat switches. J. Appl. Phys. 106, 064509 (2009).

14. Guo, D. et al. Design and modeling of a fluid-based micro-scale electrocaloric refrigeration system. Int. J. Heat Mass Transf. 72, 559–564 (2014).

15. Defay, E. et al. Enhanced electrocaloric efficiency via energy recovery. Nat. Commun. 9, 1827 (2018).

16. Gong, J. & McGaughey, A. J. H. Device-level thermodynamic model for an electrocaloric cooler. Int. J. Energy Res. 44, 5343–5359 (2020).

17. Peng, B., Fan, H. & Zhang, Q. A giant electrocaloric effect in nanoscale antiferroelectric and ferroelectric phases coexisting in a relaxor Pb0.8Ba0.2ZrO3 thin film at room temperature. Adv. Funct. Mater. 23, 2987–2992 (2013).

18. Ma, R. et al. Highly efficient electrocaloric cooling with electrostatic actuation. Science 357, 1130–1134 (2017).

19. Ponomareva, I. & Lisenkov, S. Bridging the macroscopic and atomistic descriptions of the electrocaloric effect. Phys. Rev. Lett. 108, 167604 (2012).

20. Prosandeev, S., Ponomareva, I. & Bellaiche, L. Electrocaloric effect in bulk and low-dimensional ferroelectrics from first principles. Phys. Rev. B 78, 052103 (2008).

21. Kühn, M. & Kliem, H. Monte carlo simulations of ferroelectric properties based on a microscopic model for pvdf. Phys. Status Solidi B 245, 213–223 (2008).

22. Yu, Y.-J. & McGaughey, A. J. H. Energy barriers for dipole moment flipping in pvdf-related ferroelectric polymers. Chem. Phys. 144, 014901 (2016).

23. Ma, Y.-B., Albe, K. & Xu, B.-X. Lattice-based Monte Carlo simulations of the electrocaloric effect in ferroelectrics and relaxor ferroelectrics. Phys. Rev. B 91, 184108 (2015).

24. Ma, Y.-B. et al. State transition and electrocaloric effect of BaZrx Ti1−xO3: simulation and experiment. J. Appl. Phys. 121, 024103 (2017).

25. Valant, M. Electrocaloric materials for future solid-state refrigeration technologies. Prog. Mater. Sci. 57, 980–1009 (2012).

26. Mitchell, T. M. et al. Machine Learning Vol. 45, 870–877 (McGraw Hill, Burr Ridge, IL, 1997) . .

27. Gasteiger, J. & Zupan, J. Neural networks in chemistry. Angew. Chem. Int. Ed. Engl. 32, 503–527 (1993).

28. Sumpter, B. G., Getino, C. & Noid, D. W. Theory and applications of neural computing in chemical science. Annu. Rev. Phys. Chem. 45, 439–481 (1994).

29. Thomsen, J. & Meyer, B. Pattern recognition of the 1h nmr spectra of sugar alditols using a neural network. J. Magn. Reson. (1969) 84, 212–217 (1989).

30. Keil, M., Exner, T. E. & Brickmann, J. Pattern recognition strategies for molecular surfaces: Iii. Binding site prediction with a neural network. J. Comput. Chem. 25, 779–789 (2004).

31. Agrafiotis, D. K., Cedeno, W. & Lobanov, V. S. On the use of neural network ensembles in qsar and qspr. J. Chem. Inf. Comput. Sci. 42, 903–911 (2002).

32. Ramprasad, R., Batra, R., Pilania, G., Mannodi-Kanakkithodi, A. & Kim, C. Machine learning in materials informatics: recent applications and prospects. NPJ Comput. Mater. 3, 1–13 (2017).

33. Jain, A. et al. Commentary: the materials project: a materials genome approach to accelerating materials innovation. APL Mater. 1, 011002 (2013).

34. Bergerhoff, G., Brown, I. & Allen, F. et al. Crystallographic databases. IUCr 360, 77–95 (1987).

35. Curtarolo, S. et al. Aflow: an automatic framework for high-throughput materials discovery. Comput. Mater. Sci. 58, 218–226 (2012).

36. Saal, J. E., Kirklin, S., Aykol, M., Meredig, B. & Wolverton, C. Materials design and discovery with high-throughput density functional theory: the open quantum materials database (OQMD). JOM 65, 1501–1509 (2013).

37. Pedregosa, F. et al. Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011).

38. Paszke, A. et al. Pytorch: an imperative style, high-performance deep learning library. In Advances in Neural Information Processing (eds. Wallach, H. et al.) Vol. 32, 8024–8035 (Curran Associates, Inc., 2019).

39. Abadi, M. et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467 (2016).

40. Holleis, L., Shivaram, B. & Balachandran, P. V. Machine learning guided design of single-molecule magnets for magnetocaloric applications. Appl. Phys. Lett. 114, 222404 (2019).

41. Stanev, V. et al. Machine learning modeling of superconducting critical temperature. NPJ Comput. Mater. 4, 1–14 (2018).

42. Ward, L., Agrawal, A., Choudhary, A. & Wolverton, C. A general-purpose machine learning framework for predicting properties of inorganic materials. NPJ Comput. Mater. 2, 1–7 (2016).

43. Cao, Z. et al. Convolutional neural networks for crystal material property prediction using hybrid orbital-field matrix and magpie descriptors. Crystals 9, 191 (2019).

44. Mannodi-Kanakkithodi, A., Pilania, G., Huan, T. D., Lookman, T. & Ramprasad, R. Machine learning strategy for accelerated design of polymer dielectrics. Sci. Rep. 6, 20952 (2016).

45. Su, M., Grimes, R., Garg, S., Xue, D. & Balachandran, P. V. Machine-learning-enabled prediction of adiabatic temperature change in lead-free BaTiO3-based electrocaloric ceramics. ACS Appl. Mater. Interfaces 13, 53475–53484 (2021).

46. Tian, Y. et al. Determining multi-component phase diagrams with desired characteristics using active learning. Adv. Sci. 8, 2003165 (2021).

47. Chen, T. & Guestrin, C. Xgboost: a scalable tree boosting system. In Proc. 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794 (ACM, New York, NY, USA, 2016). [Online]. Available: https://doi.org/10.1145/2939672.2939785

48. Gong, J., Chu, S., Mehta, K. M., & McGaughey, A. J. H. Link to GitHub Data set: https://github.com/Jie0705/MachieneLearning-EC-Dataset.git (2022).

49. Lu, S. et al. Organic and inorganic relaxor ferroelectrics with giant electrocaloric effect. Appl. Phys. Lett. 97, 162904 (2010).

50. Saranya, D., Chaudhuri, A. R., Parui, J. & Krupanidhi, S. Electrocaloric effect of PMN-PT thin films near morphotropic phase boundary. Bull. Mater. Sci. 32, 259–262 (2009).

51. Jiang, X., Luo, L., Wang, B., Li, W. & Chen, H. Electrocaloric effect based on the depolarization transition in (1−x)Bi0.5Na0.5TiO3−xKNbO3 lead-free ceramics. Ceram. Int. 40, 2627–2634 (2014).

52. Hao, X., Yue, Z., Xu, J., An, S. & Nan, C.-W. Energy-storage performance and electrocaloric effect in (100)-oriented Pb0.97La0.02 (Zr0.95Ti0.05) O3 antiferroelectric thick films. J. Appl. Phys. 110, 064109 (2011).

53. Meredig, B. et al. Can machine learning identify the next high-temperature superconductor? Examining extrapolation performance for materials discovery. Mol. Syst. Des. Eng. 3, 819–825 (2018).

54. Huan, T. D. et al. A universal strategy for the creation of machine learning-based atomistic force fields. NPJ Comput. Mater. 3, 1–8 (2017).

55. Qian, X.-S. et al. Giant electrocaloric response over a broad temperature range in modified BaTiO3 ceramics. Adv. Funct. Mater. 24, 1300–1305 (2014).

56. Correia, T. et al. PST thin films for electrocaloric coolers. J. Phys. D: Appl. Phys. 44, 165407 (2011).

57. Qin, J., Liu, Z., Ma, M. & Li, Y. Machine learning approaches for permittivity prediction and rational design of microwave dielectric ceramics. J. Materiomics 7, 1284–1293 (2021).

58. Takahashi, A., Kumagai, Y., Miyamoto, J., Mochizuki, Y. & Oba, F. Machine learning models for predicting the dielectric constants of oxides based on high-throughput first-principles calculations. Phys. Rev. Mater. 4, 103801 (2020).

59. Qiu, J. & Jiang, Q. Effect of electric field on electrocaloric effect in Pb(Zr1−xTix)O3 solid solution. Phys. Lett. A 372, 7191–7195 (2008).

60. Kumar, A. et al. High energy storage properties and electrical field stability of energy efficiency of (Pb0.89La0.11)(Zr0.70Ti0.30)0.9725 O3 relaxor ferroelectric ceramics. Electron. Mater. Lett. 15, 323–330 (2019).

61. Liu, W. & Ren, X. Large piezoelectric effect in Pb-free ceramics. Phys. Rev. Lett. 103, 257602 (2009).

62. Kusne, A. G. et al. On-the-fly closed-loop materials discovery via bayesian active learning. Nat. Commun. 11, 1–11 (2020).

63. Wang, W., Yang, T., Harris, W. H. & Gómez-Bombarelli, R. Active learning and neural network potentials accelerate molecular screening of ether-based solvate ionic liquids. Chem. Commun. 56, 8920–8923 (2020).

64. Pokharel, B. P. & Pandey, D. Dielectric studies of phase transitions in (Pb1−xBax) ZrO3. J. Appl. Phys. 88, 5364–5373 (2000).

65. Gao, H., Hao, X., Zhang, Q., An, S. & Kong, L. B. Thickness-dependent electrocaloric effect of Pb0.82Ba0.08La0.10(Zr0.90Ti0.10)O3 antiferroelectric thick films. J. Alloys Compd. 690, 131–138 (2017).

66. Bai, Y., Wei, D. & Qiao, L.-J. Control multiple electrocaloric effect peak in Pb (Mg1/3Nb2/3) O3-PbTiO3 by phase composition and crystal orientation. Appl. Phys. Lett. 107, 192904 (2015).

67. Sebald, G. et al. Electrocaloric and pyroelectric properties of 0.75Pb (Mg1/3Nb2/3)O3–0.25PbTiO3 single crystals. J. Appl. Phys. 100, 124112 (2006).

68. Luo, L., Dietze, M., Solterbeck, C.-H., Es-Souni, M. & Luo, H. Orientation and phase transition dependence of the electrocaloric effect in 0.71 PbMg1/3Nb2/3O3–0.29PbTiO3 single crystal. Appl. Phys. Lett. 101, 062907 (2012).

69. Peräntie, J., Hagberg, J., Uusimäki, A. & Jantunen, H. Electric-field-induced dielectric and temperature changes in a $$\left\langle 011\right\rangle$$-oriented Pb (Mg1/3Nb2/3)O3–PbTiO3 single crystal. Phys. Rev. B 82, 134119 (2010).

70. Goupil, F. L., Berenov, A., Axelsson, A.-K., Valant, M. & Alford, N. M. Direct and indirect electrocaloric measurements on $$\left\langle 001\right\rangle$$ - PbMg1/3Nb2/3O3–30PbTiO3 single crystals. J. Appl. Phys. 111, 124109 (2012).

71. Axelsson, A.-K., Le Goupil, F., Valant, M. & Alford, N. M. Electrocaloric effect in lead-free aurivillius relaxor ferroelectric ceramics. Acta Mater. 124, 120–126 (2017).

72. Zhang, J., Heitmann, A., Alpay, S. & Rossetti Jr, G. Aspects of the electrocaloric behavior of ferroelectric thin films: a review of the predictions of the Landau–Ginzburg theory. Integr. Ferroelectr. 125, 168–175 (2011).

73. Karniadakis, G. E. et al. Physics-informed machine learning. Nat. Rev. Phys. 3, 422–440 (2021).

74. Tuttle, B. A. & Payne, D. A. The effects of microstructure on the electrocaloric properties of Pb(Zr,Sn,Ti)O3 ceramics. Ferroelectrics 37, 603–606 (1981).

75. Lu, S. G. et al. Comparison of directly and indirectly measured electrocaloric effect in relaxor ferroelectric polymers. Appl. Phys. Lett. 97, 202901 (2010).

76. Kar-Narayan, S. & Mathur, N. D. Direct and indirect electrocaloric measurements using multilayer capacitors. J. Phys. D: Appl. Phys. 43, 032002 (2010).

77. Moya, X. et al. Giant electrocaloric strength in single-crystal BaTiO3. Adv. Mater. 25, 1360–1365 (2013).

78. Moya, X. & Mathur, N. Caloric materials for cooling and heating. Science 370, 797–803 (2020).

79. Friedman, J. H. Greedy function approximation: a gradient boosting machine. Ann. Stat 29, 1189–1232 (2001).

80. Ortega, N., Kumar, A. & Katiyar, R. Enhanced polarization and dielectric properties of Pb(Zr1−xTix)O3 thin films. J. Appl. Phys. 104, 074114 (2008).

81. Buixaderas, E. et al. Ultrabroadband dielectric spectroscopy and phonons in (Pb1−x/2Lax)(Zr0.9Ti0.1)O3. J. Appl. Phys. 108, 104101 (2010).

82. Chen, H. et al. Microstructure and dielectric properties of BaZrxTi1−xO3 ceramics. J. Mater. Sci.: Mater. Electron. 19, 379–382 (2008).

83. Zhai, J., Shen, B., Yao, X., Zhang, L. & Chen, H. Dielectric properties of Ba(SnxTi1−x)O3 thin films grown by a sol–gel process. J. Am. Ceram. Soc. 87, 2223–2227 (2004).

## Acknowledgements

We thank Prof. Levent Burak Kara for helpful discussions on machine learning model construction. This work was supported by the U.S. National Science Foundation under Grant No. CBET-1605000.

## Author information

Authors

### Contributions

J.G. designed and carried out the project. J.G., S.C., and R.K.M. conducted data extraction from the literature. The project was supervised by A.J.H.M. All authors discussed the results and contributed to writing the manuscript.

### Corresponding author

Correspondence to Alan J. H. McGaughey.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Gong, J., Chu, S., Mehta, R.K. et al. XGBoost model for electrocaloric temperature change prediction in ceramics. npj Comput Mater 8, 140 (2022). https://doi.org/10.1038/s41524-022-00826-3

• Accepted:

• Published:

• DOI: https://doi.org/10.1038/s41524-022-00826-3