Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

03d — Diagnostic 3: does training scope explain the gap? (transferability)

LifeWatch ERIC

Our step-2 model (Colombia only) predicts far less regrowth than the authors’ pantropical map in the same domain. This notebook trains the same model specification (make_rf of 03_analysis, ten predictors, 39,523 balanced records) on the Neotropical sample of 02c_neotropics_sample and tests transfer.

Test 1 — Colombia held out. Models trained (i) on Neotropical points outside Colombia and (ii) on all Neotropical points, are compared with our Colombia model (refitted exactly as in 03) and the authors’ map: accuracy on our Colombian validation set (2000 inputs); mean score and share of p > 0.5 on Colombian non-regrowth validation points with 2000 and with 2018 inputs; uncalibrated expected area and p > 0.5 area on the 1-in-100 systematic grid (2018 inputs, exact WGS84 pixel areas, as in 03); Pearson correlation with the authors’ map per pixel and at HEALPix depth 8.

Test 2 — transferability curve. 5-fold cross-validation on the Neotropical training pool: random folds, and folds grouped by HEALPix cell (NESTED, WGS84) at depths 6, 5 and 4 (~100, ~200, ~400 km).

set         in_colombia  label
train_pool  False        0        23760
                         1        24415
            True         0         2265
                         1         1610
validation  False        0         7938
                         1         8105
            True         0          737
                         1          570

Training sets

The Colombia model uses exactly the step-2 draw of 03. The two Neotropical models draw the same number of balanced records from the Neotropical training pool, with and without its Colombian points. Neotropical points that coincide with a Colombian validation pixel are removed from training.

colombia                   n=39,522 {0: 19761, 1: 19761} Colombian points 39,522
neotropics_excl_colombia   n=39,522 {0: 19761, 1: 19761} Colombian points 0
neotropics_incl_colombia   n=39,522 {0: 19761, 1: 19761} Colombian points 2,882

Test 1: transfer to Colombia

grid points in the prediction domain with complete predictors: 2,456,636; HEALPix d8 cells used: 1451
{'model': 'colombia', 'n_train': 39522, 'n_train_colombian': 39522, 'oob_accuracy': 0.8844, 'colombia_val_accuracy': 0.8867, 'colombia_val_n': 123356, 'neotropics_val_accuracy_excl_colombia': nan, 'nonregrowth_mean_p_2000': 0.1865, 'nonregrowth_share_gt05_2000': 0.0796, 'nonregrowth_mean_p_2018': 0.1675, 'nonregrowth_share_gt05_2018': 0.0578, 'nonregrowth_n': 61678, 'regrowth_mean_p_2000': 0.8271, 'expected_area_uncal_mha': np.float64(3.9887), 'expected_area_se_mha': np.float64(0.0025), 'expected_area_mollweide_sphere_mha': np.float64(4.015), 'area_p_gt05_mha': np.float64(2.0259), 'area_p_gt05_se_mha': np.float64(0.0037), 'pixel_pearson_vs_authors_pct': 0.6782, 'healpix_d8_pearson_vs_authors': 0.86, 'note': 'refit of the step-2 model (same draw and seed as 03)'}
{'model': 'neotropics_excl_colombia', 'n_train': 39522, 'n_train_colombian': 0, 'oob_accuracy': 0.8978, 'colombia_val_accuracy': 0.7671, 'colombia_val_n': 123356, 'neotropics_val_accuracy_excl_colombia': 0.9005, 'nonregrowth_mean_p_2000': 0.2286, 'nonregrowth_share_gt05_2000': 0.0448, 'nonregrowth_mean_p_2018': 0.2177, 'nonregrowth_share_gt05_2018': 0.0358, 'nonregrowth_n': 61678, 'regrowth_mean_p_2000': 0.6605, 'expected_area_uncal_mha': np.float64(4.4486), 'expected_area_se_mha': np.float64(0.0017), 'expected_area_mollweide_sphere_mha': np.float64(4.4779), 'area_p_gt05_mha': np.float64(0.8762), 'area_p_gt05_se_mha': np.float64(0.0025), 'pixel_pearson_vs_authors_pct': 0.5295, 'healpix_d8_pearson_vs_authors': 0.9112, 'note': 'Neotropical sample (02c); same specification as step 2'}
{'model': 'neotropics_incl_colombia', 'n_train': 39522, 'n_train_colombian': 2882, 'oob_accuracy': 0.8909, 'colombia_val_accuracy': 0.7835, 'colombia_val_n': 123356, 'neotropics_val_accuracy_excl_colombia': 0.8981, 'nonregrowth_mean_p_2000': 0.2455, 'nonregrowth_share_gt05_2000': 0.0761, 'nonregrowth_mean_p_2018': 0.2322, 'nonregrowth_share_gt05_2018': 0.0605, 'nonregrowth_n': 61678, 'regrowth_mean_p_2000': 0.6862, 'expected_area_uncal_mha': np.float64(4.6056), 'expected_area_se_mha': np.float64(0.0019), 'expected_area_mollweide_sphere_mha': np.float64(4.6359), 'area_p_gt05_mha': np.float64(1.3474), 'area_p_gt05_se_mha': np.float64(0.0031), 'pixel_pearson_vs_authors_pct': 0.4632, 'healpix_d8_pearson_vs_authors': 0.8817, 'note': 'Neotropical sample (02c); same specification as step 2'}
                                               0                         1                         2            3
model                                   colombia  neotropics_excl_colombia  neotropics_incl_colombia  authors_map
n_train                               39522.0000                39522.0000                39522.0000          NaN
n_train_colombian                     39522.0000                    0.0000                 2882.0000          NaN
oob_accuracy                              0.8844                    0.8978                    0.8909          NaN
colombia_val_accuracy                     0.8867                    0.7671                    0.7835       0.4869
colombia_val_n                            123356                    123356                    123356        62915
neotropics_val_accuracy_excl_colombia        NaN                    0.9005                    0.8981          NaN
nonregrowth_mean_p_2000                   0.1865                    0.2286                    0.2455          NaN
nonregrowth_share_gt05_2000               0.0796                    0.0448                    0.0761          NaN
nonregrowth_mean_p_2018                   0.1675                    0.2177                    0.2322       0.5188
nonregrowth_share_gt05_2018               0.0578                    0.0358                    0.0605       0.5263
nonregrowth_n                              61678                     61678                     61678        61227
regrowth_mean_p_2000                      0.8271                    0.6605                    0.6862       0.8327
expected_area_uncal_mha                   3.9887                    4.4486                    4.6056      10.3505
expected_area_se_mha                      0.0025                    0.0017                    0.0019       0.0028
expected_area_mollweide_sphere_mha        4.0150                    4.4779                    4.6359      10.4186
area_p_gt05_mha                           2.0259                    0.8762                    1.3474      11.0846
area_p_gt05_se_mha                        0.0037                    0.0025                    0.0031       0.0059
pixel_pearson_vs_authors_pct              0.6782                    0.5295                    0.4632       1.0000
healpix_d8_pearson_vs_authors             0.8600                    0.9112                    0.8817       1.0000

Test 2: transferability curve within the Neotropics

{'scheme': 'random', 'block_km_approx': 0, 'n_groups': None, 'n_folds': 5, 'n_pool': 52012, 'mean_accuracy': np.float64(0.8921), 'sd_accuracy': np.float64(0.0023), 'mean_balanced_accuracy': np.float64(0.892), 'sd_balanced_accuracy': np.float64(0.0023), 'nonregrowth_mean_p': np.float64(0.1773), 'sd_nonregrowth_mean_p': np.float64(0.0027), 'nonregrowth_share_gt05': np.float64(0.0746), 'folds_accuracy': '0.8940 0.8939 0.8883 0.8922 0.8919'}
{'scheme': 'healpix_d6', 'block_km_approx': 100, 'n_groups': 187, 'n_folds': 5, 'n_pool': 52012, 'mean_accuracy': np.float64(0.834), 'sd_accuracy': np.float64(0.0193), 'mean_balanced_accuracy': np.float64(0.833), 'sd_balanced_accuracy': np.float64(0.0195), 'nonregrowth_mean_p': np.float64(0.2028), 'sd_nonregrowth_mean_p': np.float64(0.0249), 'nonregrowth_share_gt05': np.float64(0.069), 'folds_accuracy': '0.8254 0.8181 0.8613 0.8468 0.8182'}
{'scheme': 'healpix_d5', 'block_km_approx': 200, 'n_groups': 48, 'n_folds': 5, 'n_pool': 52012, 'mean_accuracy': np.float64(0.8226), 'sd_accuracy': np.float64(0.0296), 'mean_balanced_accuracy': np.float64(0.8217), 'sd_balanced_accuracy': np.float64(0.0315), 'nonregrowth_mean_p': np.float64(0.2324), 'sd_nonregrowth_mean_p': np.float64(0.0266), 'nonregrowth_share_gt05': np.float64(0.067), 'folds_accuracy': '0.7853 0.8076 0.8195 0.8632 0.8374'}
{'scheme': 'healpix_d4', 'block_km_approx': 400, 'n_groups': 40, 'n_folds': 5, 'n_pool': 52012, 'mean_accuracy': np.float64(0.8124), 'sd_accuracy': np.float64(0.0402), 'mean_balanced_accuracy': np.float64(0.8095), 'sd_balanced_accuracy': np.float64(0.0508), 'nonregrowth_mean_p': np.float64(0.2308), 'sd_nonregrowth_mean_p': np.float64(0.0515), 'nonregrowth_share_gt05': np.float64(0.0743), 'folds_accuracy': '0.7928 0.7514 0.8355 0.8505 0.8317'}

Figure

<Figure size 1400x500 with 3 Axes>