numerai-tools 0.4.2.dev1__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/PKG-INFO +1 -1
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools/scoring.py +12 -13
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools.egg-info/PKG-INFO +1 -1
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/setup.py +1 -1
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/LICENSE +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/README.md +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools/__init__.py +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools/py.typed +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools/signals.py +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools/submissions.py +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools.egg-info/SOURCES.txt +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools.egg-info/dependency_links.txt +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools.egg-info/requires.txt +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools.egg-info/top_level.txt +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/setup.cfg +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/tests/test_scoring.py +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/tests/test_signals.py +0 -0
- {numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/tests/test_submissions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: numerai_tools
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: A collection of open-source tools to help interact with Numerai, model data, and automate submissions.
|
|
5
5
|
Home-page: https://github.com/numerai/numerai-tools
|
|
6
6
|
Maintainer: Numerai
|
|
@@ -461,7 +461,7 @@ def numerai_corr(
|
|
|
461
461
|
Returns:
|
|
462
462
|
pd.Series - the resulting correlation scores for each column in predictions
|
|
463
463
|
"""
|
|
464
|
-
targets = targets
|
|
464
|
+
targets = center(targets)
|
|
465
465
|
targets, predictions = filter_sort_index(
|
|
466
466
|
targets, predictions, max_filtered_index_ratio
|
|
467
467
|
)
|
|
@@ -557,14 +557,15 @@ def alpha(
|
|
|
557
557
|
sample_weights: pd.Series - the universe sampling weights
|
|
558
558
|
targets: pd.Series - the live targets to evaluate against
|
|
559
559
|
"""
|
|
560
|
+
targets = center(targets)
|
|
560
561
|
assert not predictions.isna().any().any(), "Predictions contain NaNs"
|
|
561
562
|
assert not neutralizers.isna().any().any(), "Normalization factors contain NaNs"
|
|
562
563
|
assert not sample_weights.isna().any(), "Weights contain NaNs"
|
|
563
564
|
predictions, neutralizers, sample_weights, targets = filter_sort_index_many(
|
|
564
565
|
[predictions, neutralizers, sample_weights, targets]
|
|
565
566
|
)
|
|
566
|
-
|
|
567
|
-
weights =
|
|
567
|
+
ranked_preds = tie_kept_rank__gaussianize__pow_1_5(predictions)
|
|
568
|
+
weights = ranked_preds.apply(
|
|
568
569
|
lambda s_prime: generate_neutralized_weights(
|
|
569
570
|
s_prime, neutralizers, sample_weights
|
|
570
571
|
)
|
|
@@ -593,6 +594,7 @@ def meta_portfolio_contribution(
|
|
|
593
594
|
sample_weights: pd.Series - the universe sampling weights
|
|
594
595
|
targets: pd.Series - the live targets to evaluate against
|
|
595
596
|
"""
|
|
597
|
+
targets = center(targets)
|
|
596
598
|
assert not predictions.isna().any().any(), "Predictions contain NaNs"
|
|
597
599
|
assert not neutralizers.isna().any().any(), "Normalization factors contain NaNs"
|
|
598
600
|
assert not sample_weights.isna().any(), "Weights contain NaNs"
|
|
@@ -611,15 +613,12 @@ def meta_portfolio_contribution(
|
|
|
611
613
|
t = targets.values
|
|
612
614
|
swp = w @ s
|
|
613
615
|
swp = swp - swp.mean()
|
|
614
|
-
|
|
616
|
+
l1_norm = np.sum(np.abs(swp))
|
|
617
|
+
l1_norm_squared = np.power(l1_norm, 2)
|
|
615
618
|
swp_sign = np.sign(swp)
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
)
|
|
621
|
-
zero_mean_jac_vec_prod = (
|
|
622
|
-
alpha_unnormalized_swp_grad - alpha_unnormalized_swp_grad.mean()
|
|
623
|
-
)
|
|
624
|
-
mpc = (w.T @ zero_mean_jac_vec_prod).squeeze()
|
|
619
|
+
swp_alpha = np.dot(swp, t)
|
|
620
|
+
directional_gradient = l1_norm * t - swp_sign * swp_alpha
|
|
621
|
+
jacobian_vector_product = directional_gradient.reshape(-1, 1) / l1_norm_squared
|
|
622
|
+
centered_jacobian = jacobian_vector_product - jacobian_vector_product.mean()
|
|
623
|
+
mpc = (w.T @ centered_jacobian).squeeze()
|
|
625
624
|
return pd.Series(mpc, index=stakes.index)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: numerai-tools
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: A collection of open-source tools to help interact with Numerai, model data, and automate submissions.
|
|
5
5
|
Home-page: https://github.com/numerai/numerai-tools
|
|
6
6
|
Maintainer: Numerai
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{numerai_tools-0.4.2.dev1 → numerai_tools-0.4.3}/numerai_tools.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|