spforge 0.8.41__py3-none-any.whl → 0.8.42__py3-none-any.whl
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.
Potentially problematic release.
This version of spforge might be problematic. Click here for more details.
- spforge/ratings/_player_rating.py +0 -1
- {spforge-0.8.41.dist-info → spforge-0.8.42.dist-info}/METADATA +1 -1
- {spforge-0.8.41.dist-info → spforge-0.8.42.dist-info}/RECORD +7 -7
- tests/ratings/test_player_rating_generator.py +53 -0
- {spforge-0.8.41.dist-info → spforge-0.8.42.dist-info}/WHEEL +0 -0
- {spforge-0.8.41.dist-info → spforge-0.8.42.dist-info}/licenses/LICENSE +0 -0
- {spforge-0.8.41.dist-info → spforge-0.8.42.dist-info}/top_level.txt +0 -0
|
@@ -445,7 +445,6 @@ class PlayerRatingGenerator(RatingGenerator):
|
|
|
445
445
|
return self._remove_internal_scaled_columns(result)
|
|
446
446
|
|
|
447
447
|
def _future_transform(self, df: pl.DataFrame) -> pl.DataFrame:
|
|
448
|
-
self._validate_playing_time_columns(df)
|
|
449
448
|
df = self._scale_participation_weight_columns(df)
|
|
450
449
|
match_df = self._create_match_df(df)
|
|
451
450
|
ratings = self._calculate_future_ratings(match_df)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spforge
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.42
|
|
4
4
|
Summary: A flexible framework for generating features, ratings, and building machine learning or other models for training and inference on sports data.
|
|
5
5
|
Author-email: Mathias Holmstrøm <mathiasholmstom@gmail.com>
|
|
6
6
|
License: See LICENSE file
|
|
@@ -51,7 +51,7 @@ spforge/performance_transformers/_performance_manager.py,sha256=lh7enqYLd1lXj1VT
|
|
|
51
51
|
spforge/performance_transformers/_performances_transformers.py,sha256=nmjJTEH86JjFneWsnSWIYnUXQoUDskOraDO3VtuufIY,20931
|
|
52
52
|
spforge/ratings/__init__.py,sha256=OZVH2Lo6END3n1X8qi4QcyAPlThIwAYwVKCiIuOQSQU,576
|
|
53
53
|
spforge/ratings/_base.py,sha256=Stl_Y2gjQfS1jq_6CfeRG_e3R5Pei34WETdG6CaibGs,16487
|
|
54
|
-
spforge/ratings/_player_rating.py,sha256=
|
|
54
|
+
spforge/ratings/_player_rating.py,sha256=n3W2t5Km88IBSbpiBmxLWQ7zg60p89DqM3Y50W8bZyA,70463
|
|
55
55
|
spforge/ratings/_team_rating.py,sha256=3m90-R2zW0k5EHwjw-83Hacz91fGmxW1LQ8ZUGHlgt4,24970
|
|
56
56
|
spforge/ratings/enums.py,sha256=maG0X4WMQeMVAc2wbceq1an-U-z8moZGeG2BAgfICDA,1809
|
|
57
57
|
spforge/ratings/league_identifier.py,sha256=_KDUKOwoNU6RNFKE5jju4eYFGVNGBdJsv5mhNvMakfc,6019
|
|
@@ -71,7 +71,7 @@ spforge/transformers/_other_transformer.py,sha256=w2a7Wnki3vJe4GAkSa4kealw0GILIo
|
|
|
71
71
|
spforge/transformers/_predictor.py,sha256=2sE6gfVrilXzPVcBurSrtqHw33v2ljygQcEYXt9LhZc,3119
|
|
72
72
|
spforge/transformers/_simple_transformer.py,sha256=zGUFNQYMeoDSa2CoQejQNiNmKCBN5amWTvyOchiUHj0,5660
|
|
73
73
|
spforge/transformers/_team_ratio_predictor.py,sha256=g8_bR53Yyv0iNCtol1O9bgJSeZcIco_AfbQuUxQJkeY,6884
|
|
74
|
-
spforge-0.8.
|
|
74
|
+
spforge-0.8.42.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
75
75
|
tests/test_autopipeline.py,sha256=gXFcyqRJwxd70MY1JOqm78RJjF-fnFdMT_FaDhBdEDE,26853
|
|
76
76
|
tests/test_autopipeline_context.py,sha256=IuRUY4IA6uMObvbl2pXSaXO2_tl3qX6wEbTZY0dkTMI,1240
|
|
77
77
|
tests/test_feature_generator_pipeline.py,sha256=CK0zVL8PfTncy3RmG9i-YpgwjOIV7yJhV7Q44tbetI8,19020
|
|
@@ -94,7 +94,7 @@ tests/hyperparameter_tuning/test_estimator_tuner.py,sha256=iewME41d6LR2aQ0OtohGF
|
|
|
94
94
|
tests/hyperparameter_tuning/test_rating_tuner.py,sha256=ZyHHAPpE-pHJmwpC7AGTFPSTDWSW4zXA6W4oKBD0v_E,18681
|
|
95
95
|
tests/performance_transformers/test_performance_manager.py,sha256=Ob4s86hdnR_4RC9ZG3lpB5O4Gysr2cLyTmCsO6uWomc,21244
|
|
96
96
|
tests/performance_transformers/test_performances_transformers.py,sha256=2OLpFgBolU8e-1Pga3hiOGWWHhjYpfx8Qrf9YXiqjUw,20919
|
|
97
|
-
tests/ratings/test_player_rating_generator.py,sha256=
|
|
97
|
+
tests/ratings/test_player_rating_generator.py,sha256=4HOvDBsIRR4JcyDujNmiLyw4YfHn__Nfx_PBR7fJCDo,115140
|
|
98
98
|
tests/ratings/test_player_rating_no_mutation.py,sha256=GzO3Hl__5K68DS3uRLefwnbcTJOvBM7cZqww4M21UZM,8493
|
|
99
99
|
tests/ratings/test_ratings_property.py,sha256=ckyfGILXa4tfQvsgyXEzBDNr2DUmHwFRV13N60w66iE,6561
|
|
100
100
|
tests/ratings/test_team_rating_generator.py,sha256=SqQcfckNmJJc99feCdnmkNYDape-p69e92Dp8Vzpu2w,101156
|
|
@@ -108,7 +108,7 @@ tests/transformers/test_other_transformer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
|
|
|
108
108
|
tests/transformers/test_predictor_transformer.py,sha256=N1aBYLjN3ldpYZLwjih_gTFYSMitrZu-PNK78W6RHaQ,6877
|
|
109
109
|
tests/transformers/test_simple_transformer.py,sha256=wWR0qjLb_uS4HXrJgGdiqugOY1X7kwd1_OPS02IT2b8,4676
|
|
110
110
|
tests/transformers/test_team_ratio_predictor.py,sha256=WA44T2HU2Tx65HO_EZaLB5ujjlxfv5uTZazh_3Mo8Zg,8463
|
|
111
|
-
spforge-0.8.
|
|
112
|
-
spforge-0.8.
|
|
113
|
-
spforge-0.8.
|
|
114
|
-
spforge-0.8.
|
|
111
|
+
spforge-0.8.42.dist-info/METADATA,sha256=WPd9RDr9-KBBx6OsFmz2EM9BOWns4oy-oYNl9BtFfb8,20048
|
|
112
|
+
spforge-0.8.42.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
113
|
+
spforge-0.8.42.dist-info/top_level.txt,sha256=6UW2M5a7WKOeaAi900qQmRKNj5-HZzE8-eUD9Y9LTq0,23
|
|
114
|
+
spforge-0.8.42.dist-info/RECORD,,
|
|
@@ -2420,6 +2420,59 @@ def test_future_transform_weighted_calculation_with_playing_time(base_cn):
|
|
|
2420
2420
|
assert 0.0 <= pred <= 1.0
|
|
2421
2421
|
|
|
2422
2422
|
|
|
2423
|
+
def test_future_transform_without_playing_time_columns_works(base_cn):
|
|
2424
|
+
"""future_transform should work when playing time columns are missing from future data."""
|
|
2425
|
+
from dataclasses import replace
|
|
2426
|
+
|
|
2427
|
+
cn = replace(
|
|
2428
|
+
base_cn,
|
|
2429
|
+
team_players_playing_time="team_pt",
|
|
2430
|
+
opponent_players_playing_time="opp_pt",
|
|
2431
|
+
)
|
|
2432
|
+
|
|
2433
|
+
# fit_transform with playing time columns present
|
|
2434
|
+
df1 = pl.DataFrame(
|
|
2435
|
+
{
|
|
2436
|
+
"pid": ["P1", "P2", "P3", "P4"],
|
|
2437
|
+
"tid": ["T1", "T1", "T2", "T2"],
|
|
2438
|
+
"mid": ["M1", "M1", "M1", "M1"],
|
|
2439
|
+
"dt": ["2024-01-01"] * 4,
|
|
2440
|
+
"perf": [0.9, 0.1, 0.5, 0.5],
|
|
2441
|
+
"pw": [1.0, 1.0, 1.0, 1.0],
|
|
2442
|
+
"team_pt": [None, None, None, None],
|
|
2443
|
+
"opp_pt": [None, None, None, None],
|
|
2444
|
+
}
|
|
2445
|
+
)
|
|
2446
|
+
|
|
2447
|
+
gen = PlayerRatingGenerator(
|
|
2448
|
+
performance_column="perf",
|
|
2449
|
+
column_names=cn,
|
|
2450
|
+
auto_scale_performance=True,
|
|
2451
|
+
start_harcoded_start_rating=1000.0,
|
|
2452
|
+
non_predictor_features_out=[RatingUnknownFeatures.PLAYER_PREDICTED_OFF_PERFORMANCE],
|
|
2453
|
+
)
|
|
2454
|
+
gen.fit_transform(df1)
|
|
2455
|
+
|
|
2456
|
+
# future_transform WITHOUT playing time columns (common for future predictions)
|
|
2457
|
+
future_df = pl.DataFrame(
|
|
2458
|
+
{
|
|
2459
|
+
"pid": ["P1", "P2", "P3", "P4"],
|
|
2460
|
+
"tid": ["T1", "T1", "T2", "T2"],
|
|
2461
|
+
"mid": ["M2", "M2", "M2", "M2"],
|
|
2462
|
+
"dt": ["2024-01-02"] * 4,
|
|
2463
|
+
"pw": [1.0, 1.0, 1.0, 1.0],
|
|
2464
|
+
}
|
|
2465
|
+
)
|
|
2466
|
+
|
|
2467
|
+
# Should not raise - playing time columns are optional for future predictions
|
|
2468
|
+
result = gen.future_transform(future_df)
|
|
2469
|
+
|
|
2470
|
+
assert len(result) == 4
|
|
2471
|
+
predictions = result["player_predicted_off_performance_perf"].to_list()
|
|
2472
|
+
for pred in predictions:
|
|
2473
|
+
assert 0.0 <= pred <= 1.0
|
|
2474
|
+
|
|
2475
|
+
|
|
2423
2476
|
def test_fit_transform_backward_compatible_without_playing_time_columns(base_cn):
|
|
2424
2477
|
"""Behavior should be unchanged when team_players_playing_time columns are not specified."""
|
|
2425
2478
|
df = pl.DataFrame(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|