{'fraction_non_alphanumeric': 0.030904954780003328, 'fraction_numerical': 0.00882206070021639, 'mean_word_length': 4.840570317563189, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Working women and caste in India: A study of social disadvantage using feature attribution

Women belonging to the socially disadvantaged caste-groups in India have historically been engaged in labour-intensive, blue-collar work. We study whether there has been any change in the ability to predict a woman's work-status and work-type based on her caste by interpreting machine learning models using feature attribution. We find that caste is now a less important determinant of work for the younger generation of women compared to the older generation. Moreover, younger women from disadvantaged castes are now more likely to be working in white-collar jobs.


INTRODUCTION
Working outside the house has historically been considered a social-stigma or a low-status activity for women in India (Eswaran et al., 2013). As a result, only the poorest women are working out of necessity in blue-collar jobs and once their family income increases, they withdraw from the workforce (Rao et al., 2010). Women tend to re-enter the work force only at high education levels that allow access to un-stigmatized white-collar jobs (Klasen & Pieters, 2012). In this cultural context, caste is an important determinant of a woman's work-status. Since scheduled castes and scheduled tribes (Sc/St) are the socially and economically disadvantaged caste groups in India, Sc/St women have always had higher workforce participation, mainly in blue-collar jobs. Upper-caste (or general caste) women have historically been discouraged from working in order to maintain a higher social-status (Eswaran et al., 2013). 2 We study whether the ability to infer a woman's work-status based on her caste is changing over generations. We also study the change in the effect of caste on work-status over generations. Adopting strategy similar to Bertrand & Kamenica (2018), we use a nationally representative dataset from the National Family Health Survey (IIPS, 2017) for training ensemble Gradient Boosting Decision Tree models to predict women's work-status. Our models uncover non-linear temporal patterns between caste and women's work-status using the SHAP (SHapley Additive exPlanation) feature attribution framework (Lundberg & Lee, 2017). SHAP values of a feature (such as belonging to the Sc/St caste) measure how important that feature is in predicting the outcome of a model (woman's work-status). Using individual-level SHAP values, we find an upward trend across generations of working women, where caste is a less important determinant of work-status for younger women. Further, we unpack the impact of caste on bluecollar and white-collar jobs, finding that younger Sc/St women are moving out of blue-collar and into white-collar jobs in India.
Our paper is related to recent studies on machine learning for development (De-Arteaga & Dubrawski, 2017;De-Arteaga et al., 2018;Mullainathan & Spiess, 2017). We demonstrate a novel usage of the SHAP framework to study social disadvantage and how it affects women's work in India. We also contribute to the aforementioned literature on caste and work by studying for the first time whether the younger generation of women are still facing the same level of disadvantage as older women.  (IIPS, 2017). The survey has information on caste, work-status, and occupation types for a representative sub-sample of 111,398 women. We consider women over 21 years of age, leaving us with 81,816 women for whom we have detailed socio-economic information for our analysis.
We classify working women into those who have blue-collar type jobs (agriculture, skilled and unskilled manual labour, and domestic services) and those who have white-collar type jobs (professional, technical, managerial, clerical, and sales). We use sixteen socio-economic features for training machine learning models to predict work-status. Appendix A presents summary statistics of the dataset and the features used.

EXPERIMENTS
We design three binary classification experiments to predict a woman's work: (1) having a job or not (work-status), (2) having a blue collar job or not (blue-collar), and (3) having a white collar job or not (white-collar). Using the sampling weights provided in NHFS-4, we create a test set with 5% of the data and use the remaining 95% for training our models in each experiment. We use stratified sampling to ensure that positive-to-negative class balance remains the same across training and test sets.
For each experiment, we train an ensemble Gradient Boosting Decision Tree (GBDT) model using LightGBM (Ke et al., 2017). We chose LightGBM due to generally strong empirical performance, fast training time, and easy compatibility with the SHAP framework. Optimal model hyperparameters are found using 5-fold cross-validated grid search over the training set. We use F1-score as the metric for choosing the best hyperparameters since it incorporates class imbalance. These hyperparameters are used to re-train each of the models on the entire training set.
Next, we interpret the trained models using the SHAP feature attribution framework for tree ensembles. Unlike traditional feature importance methods, SHAP allows for fast computation of complex tree-based, non-linear models. We compute SHAP values for our entire dataset, following Lundberg et al. (2018) as a guide to using and interpreting the explanations obtained. These explanations allow us to understand how a single feature affects the model's output, summarize relative feature importance over the entire dataset, and analyze higher order interactions among feature pairs.
Since we use a nationally representative dataset, results from our experiments represent actual country-level patterns. However, it is important to note that the accuracy of feature attribution methods is proportional to model performance. See Appendix B for a detailed discussion.

RESULTS
Global Feature Importance The SHAP summary plot for work-status experiment in Figure 1 shows the relative importance of features, the distribution of impacts of features on the model's prediction, as well as how the feature's value (Low to High) relates to its impact. Each dot represents a woman in the dataset and the x-axis position of the dot is the impact of that feature on the model's prediction. Dots that do not fit on the row pile up to show density. Since the GBDT model has a logistic loss, the x-axis has units of log-odds. Summary plots for blue-collar and white-collar experiments can be found in Appendix C.
Belonging to the Sc/St caste is the sixth most important feature in predicting work-status. State, household wealth index, age, years of education, and number of children below 5 years of age, are the five most important predictors of work-status. The observed patterns are similar to those found in existing literature: women from wealthier households are less likely to work (Rao et al., 2010), more educated women are more likely to work (Bhalla & Kaur, 2011), and Sc/St women are more likely to work (Srivastava & Srivastava, 2010). Importance of caste over generations For each of the three experiments, we plot the mean of the magnitude of SHAP values of the Sc/St Caste feature for discrete ages, along with the 99% confidence interval, to analyze whether the importance of caste has changed over generations ( Figure  2). We find that caste is more important in predicting work-status of older women than of younger women. This pattern is also observed for blue-collar jobs. For white collar jobs, there isn't a clear monotonic pattern, but overall, caste is more important for women younger than 35 years of age.
Dependence and main effects of caste The SHAP dependence plot in Figure 3 plots the SHAP values of the Sc/St Caste feature from the work-status experiment and colours them by age to visualize underlying interaction effects. We can see the attributed importance of caste change as its value varies. Higher SHAP values represent higher probability of working: Sc/St women are more likely to be working than women of other castes. The dependence plot also captures vertical dispersion at a single value of the Sc/St Caste feature due to interaction effects with other features in the model. Colouring each dot by age (as the interacting feature) we find that older Sc/St women are most likely to be working.
Next, we analyze the main effects plot for the Sc/St Caste feature by removing all the interaction effects with other features in the work-status experiment ( Figure 4). We find that Sc/St women are highly likely to be working while women of other castes are not likely to be working.  Interactions between caste and age SHAP interaction plots capture all of the vertical dispersion that was present in the SHAP dependence plot (Figure 3) but was missing from the main effects plot (Figure 4). We only focus on interaction plots between the Sc/St Caste feature and age ( Figure 5). For younger Sc/St women, SHAP interaction values are larger negatives, implying a high prediction for not-working. For older Sc/St women, SHAP interaction values are larger positives, implying a high prediction for working. Plotting the SHAP interaction values using age on the x-axis instead of caste, we get a sharper visualization of the same pattern ( Figure 6).
Note that SHAP interaction values are expensive to compute. Hence, main effect and interaction plots use a random sub-sample of 10,000 women sampled using the weights provided in NFHS-4.  Interactions for job types For fine-grained analysis, we plot the age and Sc/St Caste interaction plots for both blue-collar and white-collar experiments. We find that the pattern observed in the work-status experiment is only relevant for blue-collar jobs ( Figure 7). We observe an opposite pattern for white-collar jobs (Figure 8). Younger Sc/St women are more likely to be working in white-collar jobs while older Sc/St women are less likely to be working in white-collar jobs. This pattern is prominent mainly for women younger than 26 and older than 45 years, respectively.

CONCLUSIONS
We train machine learning models to predict women's work-status in India and analyze the relationship between work-status and caste using the SHAP feature attribution framework. We find that, over generations, caste has become a less important determinant of younger women's work-status, especially their participation in blue-collar jobs. Next, we unpack the impact of caste on work-status using SHAP interaction effects, finding that younger women of scheduled castes and scheduled tribes are less likely to be working in blue collar-jobs, and more likely to be working in white-collar jobs.
For nearly 70 years, the government of India has implemented caste-based quotas in education and government jobs to ensure equal economic opportunity. Our work can be used as a cost-effective tool to monitor the impact of the existing caste-quota policy. In future work, we will look deeper into geographical variations to identify regions where younger women are lagging, and where job creation can be targeted. Our methodology can similarly be used to study the persistence of, as well as the nuanced patterns underlying other types of social disadvantage and bias in both developing and developed country contexts.
A DATASET STATISTICS  Table 2 presents the summary statistics of the sixteen socio-economic features provided as inputs to machine learning models: each woman's personal biographical data including age, years of education, state of residence and caste (split into four binary features); information about her household such as type of residence (rural/urban), household religion, household wealth index and household members; and her health/reproductive history represented by number of children ever born, number of children currently under five years of age, whether she is anemic, whether she is obese, and her frequency of watching TV.
Among these features, we are particularly interested in looking at the relationship between workstatus and caste, which may take four values: general caste, Sc/St caste, other backward class (OBC), or unknown. To facilitate detailed analysis using feature attribution, we split caste into four binary features for each woman: whether she is from the general caste, whether she is from the Sc/St caste, whether she is from the OBC caste, and whether her caste is unknown. Having a positive value for any one of these four features means that the values of the other features are zeros.  Table 3 presents the performance of the three GBDT models described in Section 3 on the respective training and test sets. We evaluate our models based on binary accuracy and F1-score. Models for work-status and blue-collar perform acceptably and do not overfit to the training set. However, F1score for the white-collar model clearly indicates that it has overfit to the training set and generalizes poorly to unseen data. We believe this is due to extremely low class balance.
It is important to note that the SHAP frameworks explains how GBDT models work, but the models are not guaranteed to be causal. Outcomes of predicting work-status may have been impacted by several hidden factors not provided to the model or for which data collection was impossible. Hence, model performance and generalization to unseen data is a good indicator of how much we should trust the explanations produced by SHAP. In practice, we observe that using the sampling weights from NFHS-4 leads to explanations that are coherent with existing literature on gender and labour in India. Years of education, state, age, total number of children, and household members are the five most important predictors of white-collar employment. None of the features related to caste are important predictors. Highly educated women are likely to be employed in white-collar jobs, whereas women with many children or large household sizes are not. Household wealth and work-status The dependence plot of household wealth index in Figure  11 shows that most of the Sc/St women in the dataset are from the bottom three wealth levels. For women belonging to wealthier households, our model gives a high prediction for not-working. This is consistent with socio-economic literature on women's work in India (Mammen & Paxson, 2000).
State-wise patterns of work-status The dependence plot in Figure 12 shows differences in the caste-composition of working women across the states of India. It also shows state-wise differences in the likelihood of working. Women in Andhra Pradesh, Telangana, Maharashtra, Manipur, and Mizoram are most likely to be working. Women in Bihar, Assam, and Jammu and Kashmir are least likely to be working.

D ADDENDUM
Since the initial presentation of this work, we have received helpful feedback on our motivation and methodology, as well as on the literature on interpretable machine learning. We hope the following discussions are useful for future work in the intersection of social issues, demographic datasets and model interpretation using feature attribution (e.g. Vilarino & Rodrigues (2019)).
How much can we trust SHAP explanations? A broad motivation for this work was to use SHAP to discover non-linear patterns and relationships in nationally representative socio-economic datasets. In Appendix B, we discussed how performance on the predictive task used for training our model was a good indicator of the quality of downstream explanations using applying SHAP to the model's prediction. However, the relationship between model performance and SHAP explanations is not obvious. Recent work (Lipton, 2016;Rudin, 2019;Lakkaraju & Bastani, 2019;Slack et al., 2019) has highlighted several shortcomings of post-hoc explanation methods such as SHAP, leading us to be more cautious about our methodology and conclusions.
In our experiments, models trained on a subset of the full dataset were used to obtain explanations for the full dataset. Although we used a nationally representative dataset and found explanations to be coherent with existing literature, a large difference in size between the training and test sets (95% and 5%, respectively) could result in conclusions that are modelling the noise in the training data. Thus, we propose a simple robustness check to ascertain that the patterns hold for unseen data and are not 'overfit' to the training set: Given a large dataset, we can bootstrap several random subsets of the dataset for training models. We can then compare the coherence of the explanations for samples not used in training with the explanations for the full dataset.
For example, Figure 15 shows the mean of the magnitude of SHAP values for the Sc/St Caste feature across ages for the held-out test set only. Comparing Figure 15 with Figure 2, we observe similar patterns for the importance of caste over generations, albeit with higher variance in SHAP values for the test set.  Dealing with correlated features Selecting input features for training models, which are later explained using SHAP, poses an interesting challenge: if two input features are closely correlated, the model might consistently use the more predictive feature while ignoring the other. Hence, explanations based on feature attribution might show the other feature having no predictive power, which is not necessarily true.
In Figure 16, we use Spearman's rank correlation 3 as a measure of correlation for our dataset, and found features such as the household wealth index and years of education, or the number of children and age, to be highly correlated. Although no features were highly correlated with caste, we found clear trends in caste's correlation with household wealth, years of education and type of residence. General caste shows small positive correlation with higher levels of wealth and education as well as urban residences, whereas the opposite trend is seen for Sc/St caste. Thus, we believe that choice of input features and their correlations are an important consideration when analyzing model explanations from SHAP.