hkjc 0.3.3__py3-none-any.whl → 0.3.4__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.
hkjc/processing.py
CHANGED
@@ -27,7 +27,7 @@ def _process_single_qp_trade(banker: int, covered: List[int], odds_pla: List[flo
|
|
27
27
|
return (banker, covered, win_prob, exp_value, ave_odds)
|
28
28
|
|
29
29
|
|
30
|
-
def generate_all_qp_trades(date: str, venue_code: str, race_number: int, rebate: float = 0.12, harville_fit=
|
30
|
+
def generate_all_qp_trades(date: str, venue_code: str, race_number: int, rebate: float = 0.12, harville_fit=False) -> pl.DataFrame:
|
31
31
|
"""Generate all possible qp tickets for the specified race.
|
32
32
|
|
33
33
|
Args:
|
@@ -35,7 +35,7 @@ def generate_all_qp_trades(date: str, venue_code: str, race_number: int, rebate:
|
|
35
35
|
venue_code (str): Venue code, e.g., 'ST' for Shatin, 'HV' for Happy Valley.
|
36
36
|
race_number (int): Race number.
|
37
37
|
rebate (float, optional): The rebate percentage. Defaults to 0.12.
|
38
|
-
harville_fit (bool, optional): Whether to fit the odds using Harville model. Defaults to
|
38
|
+
harville_fit (bool, optional): Whether to fit the odds using Harville model. Defaults to False.
|
39
39
|
|
40
40
|
Returns:
|
41
41
|
pl.DataFrame: DataFrame with all possible trades and their metrics.
|
@@ -65,7 +65,7 @@ def generate_all_qp_trades(date: str, venue_code: str, race_number: int, rebate:
|
|
65
65
|
return df
|
66
66
|
|
67
67
|
|
68
|
-
def generate_pareto_qp_trades(date: str, venue_code: str, race_number: int, rebate: float = 0.12, groupby: List[str] = []) -> pl.DataFrame:
|
68
|
+
def generate_pareto_qp_trades(date: str, venue_code: str, race_number: int, rebate: float = 0.12, groupby: List[str] = [], harville_fit=False) -> pl.DataFrame:
|
69
69
|
"""Generate qp tickets that are Pareto optimal for the specified race.
|
70
70
|
|
71
71
|
Args:
|
@@ -74,11 +74,12 @@ def generate_pareto_qp_trades(date: str, venue_code: str, race_number: int, reba
|
|
74
74
|
race_number (int): Race number.
|
75
75
|
rebate (float, optional): The rebate percentage. Defaults to 0.12.
|
76
76
|
groupby (List[str], optional): Columns to group by when determining Pareto optimality. Defaults to [] (global optimal).
|
77
|
+
harville_fit (bool, optional): Whether to fit the odds using Harville model. Defaults to False.
|
77
78
|
|
78
79
|
Returns:
|
79
80
|
pl.DataFrame: DataFrame with all Pareto trades and their metrics.
|
80
81
|
"""
|
81
|
-
df = generate_all_qp_trades(date, venue_code, race_number, rebate)
|
82
|
+
df = generate_all_qp_trades(date, venue_code, race_number, rebate, harville_fit=harville_fit)
|
82
83
|
pareto_df = _pareto_filter(df, groupby=groupby, by=[
|
83
84
|
'WinProb', 'ExpValue'], maximize=True)
|
84
85
|
return pareto_df
|
@@ -3,11 +3,11 @@ hkjc/analysis.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
hkjc/harville_model.py,sha256=KoN5AxaAbjDkCCFUrTBSdsfZDkcINrCku9JHguofMHU,12799
|
4
4
|
hkjc/live_odds.py,sha256=i_g9ckQKA9GWbwPXNvbmNvm-dPbF9UJoGiWv6_bHzwA,4603
|
5
5
|
hkjc/optimization.py,sha256=OArQ3w9bwcIV_lTNuE5za6AROoa90xk_gwAoGwQ-8RE,3784
|
6
|
-
hkjc/processing.py,sha256=
|
6
|
+
hkjc/processing.py,sha256=HgZ0NnjCBb8Z7fX7yTLMlZiXjVIaRr1nELsE3Fs8VFE,3741
|
7
7
|
hkjc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
hkjc/qpbanker.py,sha256=vhvYb5_nGrKgYgre9gGF6tgswovca5C9pZVOPGxEP1Q,4804
|
9
9
|
hkjc/speedpro.py,sha256=vKnSz9yY1rfVmRo7GVxXLjsiQN-YgwxSbV0B7yuszS4,1702
|
10
10
|
hkjc/visualization.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
hkjc-0.3.
|
12
|
-
hkjc-0.3.
|
13
|
-
hkjc-0.3.
|
11
|
+
hkjc-0.3.4.dist-info/METADATA,sha256=Wh2uEr7WOJej-2NhKXYUlvQmcxGge0rh29Rfc5TqRPU,413
|
12
|
+
hkjc-0.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
13
|
+
hkjc-0.3.4.dist-info/RECORD,,
|
File without changes
|