![[21442C90-707F-4971-B8D0-DBA7CF050F2B_4_5005_c.jpeg|298]]
One of the biggest challenges for animal shelters is reducing **adoption returns**. Every returned dog experiences additional stress, shelters incur additional costs, and adoption resources become less available for other animals.
The goal of this project was **not only to predict which dogs are likely to be returned**, but also to understand **why** they are returned so shelters can intervene before the adoption fails.
Instead of building a pure prediction model, the objective was to answer questions such as:
- Which behavioral characteristics contribute most to returns?
- Are there measurable thresholds where return risk increases?
- Which factors can shelters actually modify before adoption?
- How can machine learning support better adoption matching?
# Dataset
The dataset contains approximately **42,000 adoptions**, with information describing both the dog and the adopter.
### Dog characteristics
- Age
- Size
- Breed group
- Medical needs
- Neutered
- Training level
- House trained
- Aggression score
- Separation anxiety
- Reactivity toward other dogs
- Energy level
### Adopter characteristics
- First-time owner
- Household with children
- Household with pets
- Home type
- Has yard
- Activity level
- Hours alone per day
### Adoption process
- Days in shelter
- Visits before adoption
- Adoption counseling
- Met resident pets
Target variable:
> **Returned (Yes / No)**
# Data Processing
The preprocessing pipeline included:
- Missing value imputation
- One-hot encoding for categorical variables
- Skewness detection
- Quantile clipping for extreme outliers
- Log transformation for highly right-skewed variables
- Yeo-Johnson transformation for left-skewed variables
- Standardization
Using a Scikit-Learn Pipeline ensured that every preprocessing step was learned **only from the training data**, preventing data leakage into the validation set.
# Models Compared
Four tree-based models were compared:
- Random Forest
- XGBoost
- LightGBM
- CatBoost
Hyperparameter tuning was performed using **RandomizedSearchCV**.
Since the business objective is identifying dogs at risk of being returned, optimization emphasized:
- Recall
- PR-AUC
rather than accuracy.
# Final Model
The best performing model was **CatBoost**.
### Best Hyperparameters
```python
{
"depth": 6,
"iterations": 400,
"learning_rate": 0.03,
"l2_leaf_reg": 5
}
```
Cross-validation PR-AUC:
> **0.367**
The decision threshold was also optimized.
Instead of using the default **0.50**, the final threshold was chosen as:
> **0.40**
This increased recall to over **80%**, allowing the shelter to identify substantially more dogs at risk of being returned.
# Model Performance
The final model achieved approximately:
- ROC-AUC ≈ **0.75**
- High recall after threshold optimization
- Moderate precision
Although ROC-AUC is not extremely high, the model is sufficiently accurate to support **risk screening**, especially because its predictions are highly interpretable through SHAP.
# Explainable AI (SHAP)
Rather than stopping at prediction, SHAP was used to understand **why** the model predicts a dog is likely to be returned.
The most important predictors were:
| Rank | Feature |
| ---- | ------------------- |
| 1 | Aggression score |
| 2 | Separation anxiety |
| 3 | Training level |
| 4 | Expectation score |
| 5 | Energy mismatch |
| 6 | Hours alone per day |
One interesting observation is that **behavioral characteristics dominate demographic characteristics**.
Variables such as breed, age, or home type contribute relatively little compared with temperament and adopter compatibility.
# Key Findings
## 1. Aggression is the strongest predictor
Aggression score is by far the most influential feature. The SHAP dependence plot shows an approximately **linear decrease** in return risk with decrease of aggression. And aggression contribute more decrease than increase on return risk. This suggests that:
- every decrease in aggression contributes lower return risk
- there is no single cutoff where dogs suddenly become "low risk"
Instead, behavioral improvement **at any aggression level** may reduce return probability.![[Screenshot 2026-08-28 at 9.36.58 PM.png|374]]
## 2. Separation anxiety steadily increases return risk
Dogs with greater separation anxiety consistently receive higher SHAP values. There is approximate moderate to high anxiety threshold where return risk will increase rapidly. Possible interventions include:
- gradual separation training
- adopter education
- follow-up support after adoption
![[Screenshot 2026-08-28 at 9.39.52 PM.png|373]]
## 3. Better training substantially reduces return risk
Training level exhibits the opposite pattern. Higher training levels steadily decrease predicted return risk. This finding suggests shelters may benefit from investing in:
- obedience training
- behavioral preparation
- training vouchers after adoption
![[Screenshot 2026-08-28 at 9.42.35 PM.png|370]]
## 4. Unrealistic adopter expectations increase returns
Expectation score is one of the strongest predictors. The SHAP relationship indicates that mismatched expectations consistently increase return probability. This emphasizes the importance of:
- realistic counseling
- clear communication about dog behavior
- educating adopters before placement
![[Screenshot 2026-08-28 at 9.43.45 PM.png|371]]
## 5. Energy mismatch matters
Dogs whose energy level does not match the adopter's lifestyle are much more likely to be returned. Rather than focusing on breed alone, shelters should improve matching based on:
- daily exercise needs
- owner activity level
- available living space
![[Screenshot 2026-08-28 at 9.47.50 PM.png|378]]
## 6. Longer time alone increases return risk
Dogs expected to spend many hours alone have progressively higher predicted return probabilities. This is especially important for dogs with:
- high energy
- separation anxiety
![[Screenshot 2026-08-28 at 9.52.46 PM.png|375]]
# Additional Findings
## Most returns occur very early
Exploratory analysis revealed:
- median time to return is approximately **one week**
- the majority of returns occur within the **first two weeks**
- predicted high-risk dogs should receive proactive support during the **first two weeks**
This suggests the first two weeks after adoption represent the highest-risk period.
Providing proactive follow-up during this window may substantially reduce returns.
# Limitations
This project predicts **association rather than causation**.
A high SHAP value indicates that a feature contributes strongly to the model's prediction, but it does not prove that changing the feature will necessarily prevent a return.
Future work could incorporate:
- causal inference
- randomized interventions
- post-adoption longitudinal data
# Conclusion
This project demonstrates how explainable machine learning can move beyond prediction to support practical decision-making.
Although CatBoost achieved a moderate ROC-AUC of approximately **0.75**, SHAP revealed that **behavioral compatibility and adopter preparedness** are far more influential than demographic characteristics.
The most important drivers of adoption returns include:
- aggression
- separation anxiety
- insufficient training
- unrealistic adopter expectations
- energy mismatch
Rather than using the model to reject adoptions, shelters can use these insights to identify high-risk matches early and provide targeted interventions such as behavioral training, improved counseling, compatibility screening, and intensive follow-up during the critical first two weeks after adoption.