Learning from the past: a machine-learning approach for predicting the resilience of locked-in regions after a natural shock

ABSTRACT Italy has been affected by many different shocks in recent years, from the Great Recession to many natural hazards. While many studies have analysed the effects of natural and socio-economic shocks on urbanized and developed areas, very few have focused on locked-in and less developed regions. In this study we focus on the pernicious effects of three earthquakes that have affected the labour markets of rural and inner municipalities of Central Italy during the last 20 years. We adopt a machine-learning technique that allows us to provide a scenario five to seven years after the earthquake for 133 municipalities affected by the Central Italy earthquake in 2016.


INTRODUCTION
The increasing occurrence of extreme natural phenomena in recent yearsand the consequent increase in the number of people and territories affectedhas led civil society and policymakers to become more aware of so-called 'socio-natural disasters'.The term, derived from the literature on disasters, suggests a sort of integrated responsibility between society and the environment for the occurrence of these events.In fact, extreme natural phenomena (e.g., floods, tsunamis, earthquakes, landslides) are very frequent, but their occurrence alone is not enough to generate a disaster.A socio-natural disaster arises when a destructive force (nature) meets the built environment and its social and economic structures (Mela et al., 2017).Considering that many scholars have already shown evidence of a positive correlation between climate change and the increase in magnitude and occurrence of extreme natural events (Stott, 2016), the discussion on how to mitigate and minimize the consequences of these events now concentrates on two levels: nature and society.This is especially true for areas that are particularly vulnerable to the effects of socio-natural disasters, such those that are locked-in in a difficult situation or in a path of underdevelopment.Socio-natural disasters can be particularly detrimental to remote and locked-in areas because they produce discontinuity in the social continuum and, in the end, work as trend accelerators (Wilson, 2014).The resilience of these areas to bounce back to pre-disaster conditions is also highly limited.As denoted by Karunarathna (2021), Kesavan and Swaminathan (2006) and Torabi et al. (2017), negative socioeconomic effects in remote and locked-in areas might be exacerbated after an extreme event because of technological, infrastructural, social, economic and gender inequities, resulting in an increased lack of opportunities and a reduction in the capacities to regenerate the livelihoods of the area affected by extreme events.
Nonetheless, it is important to highlight that the occurrence of socio-natural disasters might also provide positive opportunities in terms of development.In fact, many recovery policies are put into action in the aftermath of such events, promoting, for instance, new developing paths, changing labour market conditions of the affected areas through the research of innovative patterns and the removal of bottlenecks (Bănică et al., 2020;Berger & Luckmann, 1966;Corbo et al., 2016;Fantechi et al., 2020;Hassink, 2010).Especially in rural and remote areas, which are experiencing a long-standing depopulation process, a detrimental socio-economic environment and a permanent reduction of job opportunities, extreme events might serve as a stimulus for revitalizing labour market areas that do not benefit from proximity to urban areas.Reconstruction activities after a socio-natural disaster might create a window of opportunity that is able to revitalize areas by creating new jobs as the result of a 'creative destruction' and adaptive process triggered by an extreme event (Rizzo et al., 2022).However, this capacity depends on the resilience of the affected territories.Thus, focusing on resilience is instrumental for exploiting this window of opportunity to address the lacks and strengths of rural and remote regions.
The concept of resilience might be misleading because of its multifaceted nature that can cover different aspects.Following Dormady et al. (2018) and Rose (2007), resilience can be differentiated into a static or dynamic definition.In its static form, resilience (and especially economic resilience) is the ability of a system to maintain function and efficiently use remaining resources when shocked.In its dynamic version, resilience is the ability and speed of a system to recover and efficiently use resources for investment in recovery and reconstruction.It is also adapting to change.Even though disaster resilience is typically thought of as a static ability to withstand shocks and bounce back from hazardous events, we focus here on its adaptive aspect and describe resilience as the capacity to adapt to different socio-economic scenarios when affected by a dramatic, extreme event.A characteristic that in this study is proxied by the changes in the depopulation process experienced by the municipalities after a shock.Our work, even when analysing the preshock characteristics of affected communities, aims to forecast the capacity of municipalities to adapt after being affected by massive shocks.It should be noted that the capacity of an affected spatial labour market to adapt to new conditions might depend on several peculiar socio-economic characteristics, regardless of the level of damage and the reconstruction policy that might be implemented.
While the consequences of socio-natural disasters relative to the loss of human life and the destruction of buildings and infrastructure are clear, the medium-and long-term socio-economic consequences for these areas are more complex to predict.This paper therefore aims to create a forecasting model by means of a supervised machine-learning technique to predict the capacity of declining and locked-in labour market areas to adapt after a socio-natural disaster occurs.
In the context of this work, as a case study we examined the central Italian regions affected by the last seismic waves between 2016 and 2017.Due to the differences of the involved areas, we forecast the resilience of municipalities (mainly rural) by comparing the last two previous similar events that affected Central Italy: the earthquakes of Umbria and Marche in 1997 and L'Aquila in 2009.The rationale for the choice of these particular events and regions is twofold.All the territories under analysis show similar socio-economic and seismic risk characteristics.All the regions under analysis are characterized by small and medium-sized municipalities that are geographically isolated, presenting a deficit in terms of infrastructures and services.Second, according to Benassi et al. (2022) mountainous municipalities of Central Italy are all experiencing depopulation, about 10% in the period 2011-19.Specifically, for ultra-peripheral municipalities, the total population is even lower than that of the 19th century (Modica et al., 2021).
We applied a supervised machine-learning solution that allowed for a great deal of control on both the selection of training cases and relevant variables.Such contextspecific quantitative analysis is strongly tied to its context of application; therefore, both the training process and application of the model are specifically designed for the rural communities of Central Italy along with their peculiarities and characteristics.Exploiting the potential of advanced computational tools could be especially relevant to forecasting the outcome of a recovery process and supporting administrations in allocating resources and policies to the labour markets that most deserve them.

CASE STUDY
Central Italy is an interesting case, especially when focusing on rural labour markets, because the Apennine Mountains present an incredibly high amount of seismic activity.Indeed, three out of four major seismic events in recent decades affected the rural areas of the Central Apennines at the intersection between the four regions of Abruzzo, Marche, Umbria and Lazio.
In 2016, from the end of the summer to mid-autumn, a long earthquake swarm caused a great deal of destruction in several small rural municipalities.The seismic event started on 24 August with a shock of 6.2 moment magnitude, and the epicentre was located near the municipality of Accumuli in Lazio (INGV, 2016).The earthquake swarm caused a great deal of damage in 131 municipalities in the area jointly with several victims and injuries.Figure 1 shows the entire affected area.Among the 131 municipalities in the area, more than 60% are classified as 'inner areas'. 1 More specifically, in 2017, almost 70% of the territory is considered mountainous, and the built environment accounts for only 1.3% of it.As of 2011, the mean of the urbanized centres was about 19.3% of the territory (ISTAT, 2019).Hence, the population density of the territory is very low (14.5 inhabitants/km 2 versus an average of 200 for Italy in general, in 2017), and the average age of the population is very high: approximately 28% of the inhabitants are 65 years or older.
Despite the presence of some small urban centres, the population is widely dispersed among many small, inhabited nuclei, farms and single-dispersed houses.This wide dispersion is related to the territorial conformation of the area, predominantly mountainous, and it has important consequences for the labour market and the inhabitants' mobility.Indeed, according to 2011 Census data, the percentage of the employed population working in the same municipality of their residence is more than 5% higher than the Italian average.One potential explanation of this characteristic is that the economic structure of the area is predominated by the agricultural sector, mainly composed of family-owned business, while both the industrial and services sectors have a low added value per person of approximately €8400 compared with the Italian mean of €16,000.

METHODOLOGY
We apply a supervised machine-learning solution to individuate which municipality had the characteristics to adapt after being affected by the 2016 Central Italy earthquake.The classification of municipalities as resilient or not is performed by an algorithm trained on data of similar Italian municipalities affected by earthquakes in the last 20 years.Figure 2 summarizes the construction stages for such machine and highlights all operations and decisions to be made or performed.It shows how solving supervised machine-learning problems is an intricate bundle of human decisions and machine-computed tasks.Tasks highlighted in grey were completed by the researchers, while those shown in black indicate tasks computed by the machine.In the following sections each of the four stages (problem definition, model selection, model fine-tuning, forecasting) is presented.
All data used in this study were produced by ISTAT and are freely available online.The training of the machine is conducted using features (variables) from the Italian Census database, aggregated at the municipal level.In detail, we use data collected by the census immediately before each specific earthquake.Data regarding the municipalities affected by the Umbria and Marche earthquake of 1997 were collected from the 1991 Census.Data for the L'Aquila earthquake of 2009 were collected from the 2001 Census, and data for the Central Italy earthquake of 2016 came from the 2011 Census.Regarding the target variable (e.g., our proxy for resilience), yearly intercensal data on resident population were employed.
The empirical strategy employed in the construction of the specific machine-learning solution used in this research was divided into three main stages (Figure 2).First, the problem to be analysed is defined; this stage included the selection of training cases and the definition of both feature and target variables.Second, multiple algorithms are compared in relation with their performance in representing the training data; the best fitting algorithm is selected for the model and is tuned to better represent the training data.Third, the selected model is trained on all training cases.At this point, the model is ready to be applied to our classification problem for the municipalities affected by the 2016 Central Italy earthquake.

Problem definition
Applying a machine-learning solution to identify which municipality had the characteristics to be resilient, respond and react after being affected by an earthquake is the main aim of this work.Having defined the problem in this way, a wide variety of both general-purpose and specialized algorithms could be applied.Within the field of machine learning, there is a division between supervised and unsupervised learning (Alloghani et al., 2020), which is based on whether or not the algorithm learns from labelled data organized in a set of training examples.A supervised strategy employing a general-purpose algorithm was the most fitting approach for our research aims.Furthermore, based on both our theoretical interpretation of the dynamics involved in the case study (resilience capacity forecasting of the labour markets) and on the availability of a 'small' training dataset, we chose to adopt the so-called supervised classification learning algorithm.This means that our algorithm initially learned from a number of classified (or labelled) data and then made a prediction regarding the classification (or labelling) of a new set data (as resilient versus non-resilient municipality) based on the data's patterns.
The second step of the problem definition is the selection of training cases.The training case is a set of instances or observations with a known output (the resilience of municipalities in this specific case) through which the algorithm learns to classify municipalities as resilient or non-resilient based on a set of defined features.In our case, we use the group of all Italian municipalities affected by earthquakes in the last 20 years as the training case.The algorithm is trained to discriminate between which municipalities had the right set of characteristics that allowed a better capacity to adapt to a shock and which did not based on information (features) of the municipalities' pre-and post-earthquake situations.The main prerequisite for inclusion in the training case was that the municipality had been affected by a major earthquake within the last 20 years. 2  Within the last 20 years there were three major earthquakes in Italy before the Central Italy earthquake in 2016, but only two are of interest to this research.These two events are known as the Umbria and Marche earthquake of 1997, which mainly affected rural municipalities across the border between the regions of Umbria and Marche with 6.0 M w (Hunstad et al., 1999); and the L'Aquila earthquake of 2009, which devastated the city of L'Aquila, the capital city of the Abruzzi region, and a vast area of surrounding rural municipalities.In this event, a seismic event of magnitude 6.29 (M w ) affected the province of L'Aquila (Modica et al., 2019a).The third earthquake that occurred in Italy in the last 20 years was the Northern Italy earthquake of 2012 with a 6.1 M W (Belmonte et al., 2020).In contrast to the first two earthquakes, the Northern Italy earthquake of 2012 affected quite a different area, mostly composed of urban and peri-urban municipalities, very few rural or mountainous municipalities and a quite different economic structure.For all these reasons, this event was excluded from our work.Figure 3 shows the spatial distribution of these seismic events in the Italian territory.We also provide basic statistics in order to underline selected relevant socio-economic similarities of the areas under analysis, while Table 1 provides selected socio-economics characteristics of the two group regions under analysis.
The third step of the problem definition is the definition of the target and feature variables, namely the full set of information that the algorithm would use to learn how to discriminate different statuses or conditions (target variable) based on a set of information (feature variables).In our research design, the different statuses we would analyse and train the algorithm to classify were calculated from the differences in the dynamics of population growth between intervals of the time before and the time after an earthquake as a proxy for indication of the socio-economic capacity of a territory to recover and adapt to a shock (Fantechi et al., 2020).Even if this choice is not conventional for assessing the resilience of labour markets, given the fact that the mean resident population is not properly correlated with employment, we believe thatin this context population growth might be used as a proxy for defining the resilience of the labour market conditions of the affected areas.In fact, we argue that residential population density and employment density are correlated in areas where there is a low level of transport accessibility.Evidence of this has been emphasized in GLA Economics (2015) in the London metropolitan area, and we do believe that similar reasoning applies to the Central Italy inner areas, namely that a higher presence of residents reveals a higher opportunity for work.Furthermore, about 65% of the population in the sample works in the municipality of their residence.Finally, for remote rural areas, the number of people employed was too small, and small variations in this variable might result in huge relative changes.Thus, population is instead a more stable variable that is primarily able to capture the overall socio-economic conditions of the labour markets of a larger context.
Considering the restricted number of observations available for the training, we decided to use a dichotomous target variable.Thus, only two statuses could be assumed: 0, for 'non-resilient'; and 1, for 'resilient'.We use population growth rates before and after an earthquake to categorize the municipalities as resilient and non-resilient.Specifically, we use the mean yearly population growth rate over a five-year period before and after the earthquake.Considering that rural municipalities in Central Italy have a slow but steadily increasing rate of depopulation, we define municipalities that had a higher mean rate of population growth in the five years after the earthquake than the five years before as 'resilient'. 3All other municipalities were classified as 'non-resilient'.Formally, this is presented as: with DGrowthR ≥ 0, Resilient and DGrowthR , 0, Non − resilient.
To discriminate between the defined statuses, the algorithm would rely on a consistent set of features.Therefore, the selection of features is a key step to ensure the reliability of the algorithm.Selecting a higher number of features, theoretically, should better inform the algorithm to discriminate between statuses; howeverwhen working with real datathere is an implicit turnover between the number of features and the noise they can generate.To address this possible issue, the selection of features is performed in two steps.First, all the available features are selected, building on the literature and previous studies.The second step is computed during the training of the algorithm via a process called 'feature selection' to individuate eventual noise-generating features.
To perform an initial variable selection focusing on features connected to adaptive and resilient capacities, the selection of relevant features is strongly based on the community resilience literature (Aldrich & Meyer, 2014;Birkmann, 2007;Capello & Perucca, 2017;Cutter et al., 2016;Hallegatte & Przyluski, 2010;Morrow, 2008).Table A1 in Appendix A in the supplemental data online shows a comprehensive list of all 27 variables that were considered for the training of the machine and derived from the literature on resilience capacity in rural communities (Capello & Perucca, 2017;Cutter et al., 2016;Ross & Clay, 2018;Wilson, 2014). 4Overall, the features selected for this study address six different dimensions of a community's resilience capacity, for example, demographic, economic, infrastructural, geographical, institutional and social, as denoted by Modica et al. (2019b) and Rose (2017).

Model selection
The second stage in our empirical strategy is the selection of a fitting model, by comparing several algorithms to understand the distribution of the selected features and distinguish the known status of the target in the training data.For this stage, only training data (with known output) were used.All data were first cleaned and normalized.Second, the training database is split into a 'testing set' (which was used to select the most fitting algorithm) and a 'validation set' (used only for the final validation of the model).Finally, several algorithms were trained, and only the most accurate algorithm was validated and selected for the next stage.
Generally, most quantitative algorithms benefit from using clean and consistent data sets.While this is not a strict requirement for machine-learning algorithms, it is important because our training set is composed of different groups of observations from different years and areas.To account for these differences, all the data were normalized using the min-max method and centred on zero.
After normalizing the data, the full training database is then split into a test set and a validation set in order to compare the performance of different algorithms with a cross-validation process.The training database was composed of data with known outcomes (i.e., the target variable was known).Our training database was composed of all municipalities affected by the 1997 Umbria and Marche earthquake and the 2009 L'Aquila earthquake, making for a total of 135 observations.Of these observations, 91 were classified as 'non-resilient' and 44 as 'resilient'.Only the testing sample was employed for the crossvalidation of different algorithms.
The test set was based on a random sample made by taking 80% of the training sample (108 observations).The remaining observations (27 observations) composed the validation sample that was used to measure the accuracy of the selected algorithm.The validation sample is randomly stratified by the algorithm to account for the different proportion between 'non-resilient' and 'resilient'  b Data from the census before the specific earthquake (authors' elaboration).
2542 Federico Fantechi and Marco Modica labels.This is done to ensure that the share of statuses of the target was the same between the testing and validating sample sets.The algorithm categorizes the municipalities as resilient or non-resilient according to their features.Given the fact that the output was known, the accuracy of the algorithm could be produced based on the number of correctly categorized municipalities in the validation set.
After splitting the data, the testing set is used for the model selection process.Here, cross-validation was employed to empirically test and select the algorithm that is able to best fit and represent our data.Indeed, there was an entire array of algorithms to choose from (from decision trees to neural networks or support vectors), all with specific logics and mathematical functions.We could not know, in principle, which algorithm is more suited to represent our set of data; hence, a cross-validation strategy is dedicated to compare them. 5 In the problem definition of our work, we constrained the research to a supervised machine-learning classification problem.Thus, only classification algorithms were cross-validated.Since this is, to our knowledge, one of the first empirical studies to apply a machine-learning solution to produce an ex-ante forecast of community resilience, we thus had no baseline for the selection of algorithms.Therefore, we focused on well-supported, non-specialized algorithms.This led to the selection of six general-purpose classification algorithms that were among the most common and whose use should reduce the possibility of over-fitting on our training data and whose performance would be well adapted to a reduced set of training data.The six selected algorithms are the following: a logistic regression classifier (LR), a k-neighbours classifier (KNN), a decision tree classifier (CART), a naive-Bayes Gaussian classifier (NB), a linear support vector machine classifier (LinearSVM) and a simple neural network (MLPClassifier).
The performance of these different algorithms was compared using a repeated cross-validation strategy with five splits and 100 repeats.This means that the testing set is split into five subgroups (subgroups were randomized through a randomly generated number), each composed of 21 observations.Each algorithm trained on four of these groups, and with the last (the fifth) group, the algorithm's classification accuracy was verified.Each algorithm was trained and tested 100 times on differently composed groups.In other words, the learning strategy consisted of training each algorithm on four of the five testing sets and validating the algorithm with the remaining data set.Finally, the algorithms were compared by their mean accuracy and standard deviation.Each cross-validation repetition reported the share of correct classifications.The cross-validation scores are presented in Table 2.The first entry (baseline) shows the accuracy for a random selection algorithm.This algorithm is not considered a candidate for model construction and only provided a baseline for comparison between the other algorithms and a random selection of the target.
Table 2 shows that the most accurate algorithm was the logistic regression classifier, which had an accuracy of 82.0%.Thus, it was the chosen algorithm for this work.

Model fine-tuning
The next stage in the machine-learning technique is the fine-tuning of the model.The aim of this step was to provide the most accurate configuration of parameters (a socalled hyperparameters tuning) and highlight the less relevant features (variables) of the model (the features selection).This stage represents one of the key strengths of the machine-learning technique.In fact, the advantage of a machine-learning solution is that it allows the performance of an algorithm to be compared with all the possible configurations of parameters and for the most accurate to be selected.The fine-tuning is done in two steps: first, all possible defined variations of the model were trained and their accuracy was compared via a cross-validation process; and second, the final set of features is selected after testing for eventual noise-producing features.
The set of parameters the selected algorithm was tuned to was limited to two main groups: the solver and the penalty.The solver is a specific algorithm used in the optimization problem to discriminate between elements (target statuses) based on some criterion (training features). 6In the context of this study, we tested three different solvers for our model: 'newton-cg', 'lbfgs' and 'liblinear'.The first two algorithmsthe newton-cg algorithm and the lbfgs algorithm (limited-memory Broyden-Fletcher-Goldfarb-Shanno algorithm)solve functions by finding zeroes or local maxima and minima.In contrast, the liblinear algorithm (library for large linear classification algorithm) uses a coordinate descent method to perform approximate minimization of the function.
The second group of parameters tuned involved the norm and intensity of the penalty term.For penalty term is intended the method and intensity of the regularization applied to the coefficients of the algorithm.Very generally, regularization is the process of introducing 'additional information' to prevent overfitting.For the context of our study, this was done by testing different methods and different intensities of penalty.Specifically, we tested two different regularization methods: L1 (when Learning from the past: a machine-learning approach for predicting the resilience of locked-in regions after a natural shock 2543 implemented in a linear regression model, it is commonly known as 'lasso regression') and L2 (when implemented in a linear regression model, it is commonly known as 'ridge regression').Both regularisations worked on the weights of the coefficients (by either reducing them or pushing them to zero).However, the main difference between the two methods can be defined by the fact that L1 regularization will eliminate less relevant features (pushing their weights to zero), while L2 regularization will only shrink them proportionally.In this work, the cross-validation process reported the best fitting combination being: 'liblinear' solver alongside a soft L2 'ridge regression' penalty.Finally, we highlight the less relevant features (variables) of the model by testing whether adopting a reduced set of features would sensibly improve the accuracy of our model.This is done by evaluating both the individual correlation between each feature and the target and their cumulative explanatory capacity.This step help us in three ways: (1) it showed which variables were more relevant for the context, (2) it controlled the robustness of the model and (3) it identified variables that added noise to the analysis (Byeon & Rasheed, 2008).
In performing this step, we run an F-test on all features to examine the difference in group means for our dependent (target) variable.However, since the F-test only captures correlation and is not able to capture non-linear effects, to consider the combined effect of features, we also performed recursive feature elimination (RFE) again with cross-validation (Guyon et al., 2002). 7RFE works recursively by training the model on all the given features.The algorithm then uses the weight of each feature to rank the features in a decreasing relevance order (the weights' absolute value is used here to reflect the importance of the features) and removes the least important feature.The task is repeated until all features are ranked.
By eliminating one feature at a time, we were able to compare the accuracy of the model when running with a reduced set of features.Figure 4 shows the change in accuracy for models using a different number of features.The RFE returned an optimally reduced model that used only 17 of the 27 features and scored 0.836 in accuracy.This model had a small increase in mean accuracy from the logistic classifier model with complete features, which scored 0.820.However, this small increase in accuracy (1.6%) was not enough to justify the adoption of a reduced model, and we adopted the full model in our analysis.

Forecasting
The last stage of the process is to train the final model and then apply it to our case study.The tuned modeltested on the validation setand its performances are presented in Table 3, while the results of the forecast are presented and discussed in the next section.As stated previously, we used the logistic regression classifier algorithm that had been trained over the full set of 27 variables and had presented an 82% degree of accuracy before tuning.As mentioned above, we defined municipalities that in the five years after the earthquake had a higher mean rate of population growth than the five years before as 'resilient'.All other municipalities are classified as 'non-resilient'.
Table 3 provides the main classification metrics on a per class basis.The first two metrics indicate the ability of the algorithm to provide precise results in terms of: probability to classify correctly an instance (probability) instance, and to find all correct instances (recall).Finally, the F1 score is a weighted harmonic mean of precision and recall, and the support column indicates the number of actual occurrences of the class in the validation set.The last three rows of Table 3 show the micro average (which in our binary classification corresponds to the accuracy of the model), macro average (averaging the unweighted mean per class) and weighted average (averaging the support-weighted mean per class).The model correctly classified 23 out of the 27 cases submitted.Among the four misclassified cases, three were classified as 'non-resilient', even though they were not, and only one case was misclassified as 'resilient'.As shown in the 'recall' column of Table 3, the model is fairly confident in classifying 'non-resilient' cases and less confident when classifying cases as 'resilient'.Nevertheless, the overall accuracy of the final modeltested on the validation setis quite robust (89%), with an increase of accuracy of 7% compared with the initial cross-validation score obtained by the LR algorithm on the training set.Class accuracies and recalls columns, alongside the higher accuracy in the validation, suggests the presence of some levels of bias in our model leading to misclassification issues.These misclassification issues can be partially dealt with thanks to the confidence intervals provided by the logistic regression classifier (Elazmeh et al., 2006), as discussed in the next section.
When we trained the model with all the training cases to be applied on the problem of rural municipalities affected by the Central Italy earthquake of 2016, we adopted the logistic regression classifier with a 'liblinear' solver, no intercept scaling and no weights for the parameters. 8To reduce the possibility of overfitting issues, soft L2 regularization (ridge regression) was employed, penalizing high-valued regression coefficients (Friedman et al., 2001).The results illustrated a possible scenario five to seven years after the 2016 earthquake that indicated which affected municipalities had the set of features that would allow for better resistance to the shock and lead to reduced loss of wealth and jobs.The results also showed which municipalities would need a large public intervention to resist and recover.The equation for the final Learning from the past: a machine-learning approach for predicting the resilience of locked-in regions after a natural shock model is the following: The specific composition of the model, for example, coefficients, features' weights and role, already provides interesting information on the specific composition of resilience abilities for the area of study.This is discussed, along with the other produced results, in the next section.

RESULTS AND DISCUSSION
Our forecasting model provides a scenario for five to seven years after the 2016 earthquake for the 133 municipalities affected by the summer 2016 earthquake.This scenario answers the two most important questions of this research.
Our study provides evidence of the main characteristics that influence the resilience of locked-in, declining regions after a natural shock, such as an earthquake.This also means that we are able to classify the main socio-economic and spatial characteristics of different labour market areas that might reduce the negative impact of a shock.Second, based on the wide range of features used in the model, we can classify the municipalities according to their capacity to recover from the shock and adapt to a new scenario.In this way, we are able to identify the areas that would experience a drop in predicted employment and population growth if no public interventions were to take place after the shock occurs.
Table 4 shows the coefficients applied to each variable after the training process and their importance (ranked accordingly with the RFE).This information already provides interesting information on how resilience is composed in a rural context, especially regarding economic dimensions.In this regard, it is worth noting several socio-economic characteristics that are relevant to increasing the resilience of the studied rural municipalities.First, both employment and female employment positively influenced the capacity to resist a shock to the affected areas.However, the magnitude of the coefficient (and its feature importance) for female employment results appears to be higher, suggesting female participation in the job market to have a positive impact on increasing the degree of economic resilience.Second, the presence of a specialization in only one sector, which in our work is agriculture, increases the resilience of the municipality.This evidence on specialization is interesting because it differs from previous works that focused on an urban context where the role of specialization is mixed (e.g., it decreases the capacity to resist a shock but increases the capacity to adapt; see Cainelli et al., 2019, for details).More importantly, when we compare this result with those of specialization in terms of local labour market areas (manufacturing, agriculture and tourism), the only positive coefficients are those where the specialization is in agriculture.
The social sub-dimension showed another interesting behaviour.Specifically, the number of non-profits and the share of voter turnout revealed positive coefficients, indicating that in a community where the participation of citizens is higher, the resilience tends to be higher.On the contrary, when looking at the size of families, the estimated coefficients show negative values, indicating a lower capacity for larger families to face external shocks.The spatial and geographical subdimensions also showed interesting information.Indeed, while most of these variables (e.g., distance from the nearest urban pole or the urban share of inhabitants) behave as expected, the altitude variable (i.e., the median altitude of the municipality) reported a positive coefficient.This could suggest thatin an all-rural context such as the one under analysiswhile the remoteness (distance from urban centre) of the community still plays an expected negative role, the actual altitude of the community does not.Finally, when looking at the seismic intensity of the earthquake, the data shows that the higher the shock is (in terms of magnitude), the higher the resilience of the place.This is probably because the reconstruction activities in these places have produced positive effects in terms of new job opportunities.In the second part of the analysis, we present the results of the machine-learning model.The forecasting model is applied to the municipalities affected by the summer 2016 earthquake.As reported in the problem definition section, we focused on classifying municipalities into two classes, resilient versus non-resilient, that represent the resilient capacity of the municipalities of interest.The algorithm thus categorized the identified municipalities into the two different classes, assigning a probability that a particular municipality belongs in one of the specific classes.This process was based on the training conducted with the algorithm using data on municipalities affected by two previous earthquakes.
This means, that the algorithm classified the municipalities affected by the 2016 earthquake as resilient or non-resilient according to their pre-earthquake features and given what occurred in the municipalities during the 1997 and 2009 earthquakes.This process provides a forecasting scenario for those municipalities to show, given their features, whether they will show a resilient labour market or not after an earthquake.It also provides potential guideline for regional policymakers.
Because we are aware that our algorithm has a slight tendency to misclassify some bordering (bordering between the two classes) municipalities, we exploit the confidence intervals provided by the algorithm to create a third intermediate class.The 'rule of thumb' in this case is the following: (1) if the algorithm classified a set of municipalities as 'non-resilient', we assigned this set of municipalities to the category of 'low resilience capacity'; and (2) if the algorithm classified the municipalities as 'resilient', we classified the municipalities as 'high resilience capacity' only when the algorithm provided a probability higher than 80%.Otherwise, municipalities were classified as 'intermediate resilience capacity'.Thus, our final representation of the results shows a classification into three classes: 'high resilience capacity', 'intermediate resilience capacity' and 'low resilience capacity'.Figure 5 shows the spatial and geographical distribution for our simulation.
The results show some geographical patterns.The probability of success changes from high to low when moving toward the centre of the epicentral area.Municipalities with a higher chance of being resilient are clustered at the border and in the northern part of the affected area.Conversely, lower probabilities of success are found in the southern part of the affected area.Four administrative Italian regions were involved in the earthquake (Marche, 83; Abruzzo, 22; Umbria, 14; Lazio, 14).Among those, Lazio and Umbria have the largest relative share of Learning from the past: a machine-learning approach for predicting the resilience of locked-in regions after a natural shock 2547 municipalities with a 'high and intermediate resilience capacity' (64% and 58%, respectively).Marche holds the largest share of municipalities with a 'low resilience capacity' (39%), followed by Umbria (28%).Table 5 shows the 10 most likely 'high resilience capacity' and 'low resilience capacity' municipalities.For a complete list, see Appendix B in the supplemental data online.Results shown in Figure 5 and Table 5 are able to underline the municipalities that, given their pre-event socio-economic characteristics and on the base of previous seismic events used to train the ML algorithm, might be not able to adapt to the new post-earthquake scenario and they deserve more financial support.To determine some of the driving factors in our model, we show in Figures 6 and 7 the geographical distribution for some of the most impacting economic and social features.The share of workers employed in agriculture (Figure 6a) and the share of cooperative workers (Figure 6b) are distributed differently from our scenario, while female participation in the job market, income and rents (Figure 6c-e) shown to be highly correlated in our scenario especially when comparing their fourth quartiles with the distribution of 'high resilience capacity'.When looking at the social characteristics (Figure 7), the share of people commuting daily for work or study (Figure 7a) shows the most similar distribution to our scenario.Considered together, Figure 7b (share of people with no high school diploma), Figure 7e (share of people speaking Italian as a first language) and Figure 7c (share of numerous families) seem to suggest that more open communities hold a higher capacity for resilience.Finally, despite not showing a similar distribution to our scenario, the fourth quartile in Figure 7d (number of non-profit associations per 1000 inhabitants) is mostly clustered in the same area classified as 'intermediate resilience capacity'.This suggests that, while not having a primary role, the kind of community-participation produced by presence of non-profit associations can be a sort of balance needle toward a successful recovery process.
From our scenario, a socio-economic profile of the 'high resilience capacity' municipality emerges.Indeed, the analysis suggests that communities characterized by an open and inclusive social structure and a less 'traditional' job market have better chances of holding higher capacity for resilience, while a quite homogeneous economic structure does not seem to have a direct correlation with the resilience capacity output (unlike job market  Federico Fantechi and Marco Modica

REGIONAL STUDIES
and income).Finally, participation in community social life might play a very important role.

CONCLUSIONS
This paper is, to our knowledge, the first attempt to develop a context-bound approach for forecasting the resilience of locked-in municipalities.Our model was developed specifically for Italian rural communities based on their long-term socio-economic processes.
By adopting a supervised machine-learning strategy, we were able to provide a simple and communicative way of visualizing and analysing the resilience capacity of communities that can be applied to many different scenarios.The novelty of our approach can be stated through three elements.First, our overall research strategy was based on the principle that geography and history are key inputs in shaping the characteristics of regions and labour markets.In the construction of our scenario, we used data from the municipalities that covered a 20year-long period to learn which communities were resilient and how they were able to successfully adapt after a socio-natural disaster.The second novelty lies on the fact that, we used supervised machine learning to develop a statistical model that could identify the economic resilience of rural municipalities in Central Italy.This method enabled us to input a wide range of features in the modelling of our scenario without assuming which characteristics composed resilience ability.It also allowed us to explore how local labour markets would react to a shock in general and to the 2016 earthquake in our specific case.The final novelty of our approach is that we did not assume the composition of resilience, and we instead decided to first define resilient communities andfrom thislet the algorithm compose the model.These choices led us to develop a model that is, at the same time, highly specific in its results but with the possibility to adapt the algorithm to other events.
The scenario emerging from our forecasting model is set five to seven years after the disaster and provides indications about (1) which municipalities already have the right set of characteristics to be able to successfully adapt and (2) which municipalities need institutional interventions and investments to avoid falling behind even more.As shown in Figure 5, municipalities with less chances of being resilient are clustered in the central-southern part of the affected area at the intersection of the four administrative regions.Our scenario only provides information about the probability of the affected municipalities completing a successful adaptation process given their initial situation.However, our work can provide direct indications about which features are missing in a specific area and which can be improved to create a positive impact.In the context of Central Italy, municipalities with the highest chance of a successful recovery are those with higher levels of female participation in the job market, higher cultural capital and more culturally open and inclusive conditions.Through individual features and the profile of a 'high resilience capacity' community, what we delineated can be translated into policy directions.Moreover, a specific focus on a single municipality can provide further information and a baseline for specific actions and investments.

DISCLOSURE STATEMENT
No potential conflict of interest was reported by the authors.

NOTES
1. Generally, inner areas are economically vulnerable municipalities situated far from cities and large urban agglomerates.2. We exclude municipalities affected by major earthquakes before the 1990s (e.g., the Friuli earthquake in 1976 and the Irpinia earthquake in 1980) due to changes in the structure and content of the Italian Census over the years.3. The start of the 'five-year period after the earthquake' is lagged two years after the event.4. The nominal number of features in the model is actually 31.This is due to the feature 'Population trend', recording the population growth trend in the period before the earthquake, which is split into five features recording yearly variations rates.5.The different logical and mathematical functioning of the algorithms is not discussed here, but see Aggarwal (2014).6.Indeed, there are different methods to solve, for example, a logistic regression, therefore different specific algorithms can be employed.These 'specific' algorithms are called solvers.7. We provide results for the RFE only; details on the Ftest are available from the authors upon request.8. Liblinear is an open-source library for large-scale linear classification.The solver is a linear classificator that supports logistic regression and linear support vector machines.It is recommended when one has a high-dimension dataset.

Figure 1 .
Figure 1.Area in Central Italy affected by the summer 2016 earthquake.

Figure 2 .
Figure 2. Supervised-ML algorithm training diagram.Note: Tasks highlighted in grey were completed by the researchers, while those shown in black indicate tasks computed by the machine.

Figure 3 .
Figure 3. Locations where major earthquake events have occurred in the last 20 years in Italy.

Figure 5 .
Figure5.Scenario of the ability for community resilience after the summer 2016 earthquake.

Figure 6 .
Figure 6.Most impactful economic features: (a) workers employed in agriculture; (b) cooperative workers; (c) female participation to job market; (d) declared mean income; and (e) families living in a renting situation.Note: Readers of the print article can view the figures in colour online at https://doi.org/10.1080/00343404.2022.2089644

Figure 7 .
Figure 7.Most impactful social features: (a) people commuting daily; (b) people with no high-school diploma; (c) numerous families; (d) number of non-profits; and (e) people speaking Italian as a first language. 2548

Table 1 .
Selected socio-economic characteristics of affected versus training regions.
Note: a Data from the 2011 Italian Census (authors' elaboration).

Table 4 .
Coefficients and ranks of the features.

Table 5 .
Most likely high-and low-resilience capacity municipalities (forecasted class and relative probability).