|
1 | 1 | # |
2 | | -# This code is soft-deprecated. It is recommended that you use |
| 2 | +# This code is deprecated. It is recommended that you use |
3 | 3 | # the numerai-tools package instead: |
4 | 4 | # https://github.com/numerai/numerai-tools |
5 | 5 | # |
@@ -316,27 +316,27 @@ def validation_metrics( |
316 | 316 | lambda d: d[feature_cols].corrwith(d[pred_col]).abs().max() |
317 | 317 | ) |
318 | 318 | max_feature_exposure = max_per_era.mean() |
319 | | - validation_stats.loc[ |
320 | | - "max_feature_exposure", pred_col |
321 | | - ] = max_feature_exposure |
| 319 | + validation_stats.loc["max_feature_exposure", pred_col] = ( |
| 320 | + max_feature_exposure |
| 321 | + ) |
322 | 322 |
|
323 | 323 | # Check feature neutral mean |
324 | 324 | feature_neutral_mean = get_feature_neutral_mean( |
325 | 325 | validation_data, pred_col, target_col, features_for_neutralization |
326 | 326 | ) |
327 | | - validation_stats.loc[ |
328 | | - "feature_neutral_mean", pred_col |
329 | | - ] = feature_neutral_mean |
| 327 | + validation_stats.loc["feature_neutral_mean", pred_col] = ( |
| 328 | + feature_neutral_mean |
| 329 | + ) |
330 | 330 |
|
331 | 331 | # Check TB200 feature neutral mean |
332 | 332 | tb200_feature_neutral_mean_era = validation_data.groupby(ERA_COL).apply( |
333 | 333 | lambda df: get_feature_neutral_mean_tb_era( |
334 | 334 | df, pred_col, target_col, 200, features_for_neutralization |
335 | 335 | ) |
336 | 336 | ) |
337 | | - validation_stats.loc[ |
338 | | - "tb200_feature_neutral_mean", pred_col |
339 | | - ] = tb200_feature_neutral_mean_era.mean() |
| 337 | + validation_stats.loc["tb200_feature_neutral_mean", pred_col] = ( |
| 338 | + tb200_feature_neutral_mean_era.mean() |
| 339 | + ) |
340 | 340 |
|
341 | 341 | # Check top and bottom 200 metrics (TB200) |
342 | 342 | tb200_validation_correlations = fast_score_by_date( |
@@ -372,9 +372,9 @@ def validation_metrics( |
372 | 372 | lambda d: unif(d[pred_col]).corr(unif(d[example_col])) |
373 | 373 | ) |
374 | 374 | corr_with_example_preds = per_era_corrs.mean() |
375 | | - validation_stats.loc[ |
376 | | - "corr_with_example_preds", pred_col |
377 | | - ] = corr_with_example_preds |
| 375 | + validation_stats.loc["corr_with_example_preds", pred_col] = ( |
| 376 | + corr_with_example_preds |
| 377 | + ) |
378 | 378 |
|
379 | 379 | # Check exposure dissimilarity per era |
380 | 380 | tdf = validation_data.groupby(ERA_COL).apply( |
|
0 commit comments