KivaScore Technical Methodology
KivaScore calculates repayment likelihood and estimated social impact independently. The repayment pipeline is a supervised machine-learning model. The impact pipeline combines three structured rubric classifiers with one deterministic vulnerability module.
1. Repayment Score
Target and output
The deployed model is an XGBClassifier with a binary logistic objective. It estimates default probability. The site displays:
Repayment Score = 100 × (1 − predicted default probability)
Deployed feature set
The following fields are read directly from the deployed xgboost_deployable_pipeline.joblib.
| Group | Features |
|---|---|
| Loan | loan_amount, repayment_term, loan_use_chars, loan_use_words, posted_month, posted_weekday |
| Country / macro | agriculture_value_added_pct_gdp, domestic_credit_private_sector, gdp_growth, gdp_per_capita, inflation, population_total, rural_population_pct, unemployment |
| Governance | control_of_corruption, government_effectiveness, rule_of_law |
| Borrower / group | borrower_count, female_percent, all_female, all_male, mixed_gender |
| Location / climate | latitude, longitude, climate_pdsi, climate_tmax |
| Field partner | partner_default_rate, partner_loans_posted, partner_avg_loan_amount, partner_avg_repayment_term, partner_avg_days_to_fund, partner_avg_borrowers_per_group |
| Categorical | sector, repayment_interval |
Preprocessing
- Numeric missing values: median imputation.
- Categorical missing values: most-frequent imputation.
- Categorical and boolean fields: one-hot encoding with unknown categories ignored.
- Class imbalance:
scale_pos_weight = negatives / positivesusing training data only.
XGBoost parameters
| Parameter | Value |
|---|---|
objective | binary:logistic |
eval_metric | aucpr |
n_estimators | 500 |
learning_rate | 0.05 |
max_depth | 6 |
min_child_weight | 5 |
subsample | 0.8 |
colsample_bytree | 0.8 |
tree_method | hist |
random_state | 42 |
Temporal split
The deployable training script uses loans through 2012 for training and 2013 as the out-of-time test year. Country, governance, climate, and partner-history features are joined to the loan records before training.
2. Impact Score
Final aggregation
Each component is scored on a 0–5 scale. The raw impact score is:
Raw Impact = 0.25 × Immediate + 0.20 × Future + 0.20 × Community + 0.35 × Vulnerability
The raw score is converted to a percentile against the recent impact reference distribution used by the live scoring pipeline. The displayed 0–100 Impact Score is that percentile.
2.1 Immediate Impact — 25%
The classifier uses activity and loan use first, and the description when needed. It assigns one primary immediate-impact class plus structured livelihood and household labels. Python, not the language model, calculates the numeric score.
| Primary class | Base score |
|---|---|
critical_health_or_survival | 5.0 |
health_safety_or_basic_need | 4.4 |
protects_existing_livelihood | 4.0 |
creates_new_livelihood | 3.5 |
education_access_or_continuity | 3.25 |
expands_existing_livelihood | 3.0 |
meaningful_household_or_personal_improvement | 2.5 |
maintains_existing_livelihood | 2.0 |
minor_immediate_opportunity | 1.0 |
no_clear_immediate_impact | 0.0 |
Supporting labels add 0.10 each, capped at +0.30. Distinct secondary-impact boosters are grouped to prevent duplicate effects from stacking and are capped at +1.50. The final Immediate score is capped at 5.0.
2.2 Future Impact — 20%
The structured classifier returns purchase type, value horizon, evidence strength, and binary signals for durable or persistent future value. Routine restocking is explicitly normalized to maintenance rather than treated as new capacity.
Examples of purchase-type base scores:
one_time_consumption: 0.75routine_inventory_or_restock: 1.50recurring_production_input: 2.00maintenance_or_repair: 2.25durable_productive_asset: 3.25startup_or_first_business_input: 3.50capacity_expansion: 3.75education_or_skill: 4.00
Value-horizon scores are 0.5 (one-time), 1.5 (short), 3.0 (medium), 4.25 (long), and 5.0 (potentially lifelong). Evidence multipliers are 0.88 (low), 0.95 (medium), and 1.00 (high).
Future = 5 × (magnitude / 5)^0.65 × (duration / 5)^0.35 × evidence multiplier
Additional deterministic adjustments reward new income capacity, durable productive capacity, durable skills, persistent health/function benefits, and persistent household infrastructure; a maintenance-only classification receives a penalty.
2.3 Community Impact — 20%
Community impact is restricted to benefits outside the borrower-side group. The classifier is instructed not to infer future hiring, geographic scarcity, future expansion, or borrower success.
Community = (community potential)^0.65 × (loan contribution)^0.35
Community-potential labels map to 0.5, 1.5, 3.5, 4.5, or 5.0 for minimal through very high. Loan-contribution labels map to 0.5, 1.25, 3.5, 4.5, or 5.0 for none through transformative.
2.4 Vulnerability — 35%
Vulnerability does not use an LLM or web search in the live pipeline. It has two deterministic parts.
- Household: conservative phrase rules score only explicit evidence such as dependents, single-parent status, unstable income, illness, recent shocks, lack of savings, financial exclusion, insecure tenure, or documented constraints. Missing information remains neutral.
- Area: latitude/longitude are matched to a World Bank SPID admin-1 polygon. The live indicator is
poor420, the estimated share of the region below $4.20/day.
Area vulnerability = 0.5 + 4.5 × poor420
Household scoring starts from 2.50 and applies capped rule-group adjustments. Area and household weights adapt to household evidence:
| Household evidence | Area weight | Household weight |
|---|---|---|
| Low | 0.65 | 0.35 |
| Medium | 0.50 | 0.50 |
| High | 0.40 | 0.60 |
The module preserves strongly supported extreme scores and clamps the final vulnerability score to 0.5–5.0.
3. Explanations and Compare Mode
Borrower-specific explanations are generated only after the underlying repayment or impact score exists. They summarize the factors behind a score and do not determine the score.
Compare Mode sends each loan through the same repayment and impact pipelines, then displays up to six loans side by side and allows sorting by repayment, impact, or the combined view.