Penalty
pangadfs.penalty
¶
Penalty framework¶
Idea is to replace optimizer rules with penalties. Penalties can be negative (bad) or positive (good). * Advantages * Doesn't throw away reasonable options (125% ownership arbitrary) and is flexible. * Does not require absurdly complex optimizer rules. * Can easily layer penalties on top of each other. * Disadvantages * Takes some fiddling to get the parameters correct.
Possible penalties¶
- Individual ownership penalty (global or just high-owned)
- Cumulative ownership penalty (global or just high-owned)
- Distances (too many similar lineups)
- Diversity (another way of measuring too many similar lineups)
- Position combinations (QB vs DST, WR + own DST, etc.)
DistancePenalty()
¶
Bases: PenaltyBase
Source code in pangadfs/base.py
penalty(*, population)
¶
Calculates distance penalty for overlapping lineups
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
ndarray
|
the population |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: 1D array of float |
add parameters for positional weighting
that is, can prioritize distance at WR or other position conversely, can deprioritize distance at RB or other position
Source code in pangadfs/penalty.py
DiversityPenalty()
¶
Bases: PenaltyBase
Source code in pangadfs/base.py
penalty(*, population)
¶
Calculates diversity penalty for overlapping lineups
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
ndarray
|
the population |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: 1D array of float |
Source code in pangadfs/penalty.py
HighOwnershipPenalty()
¶
Bases: PenaltyBase
Source code in pangadfs/base.py
penalty(*, ownership, base=3, boost=2)
¶
Calculates penalties that are inverse to projected ownership
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ownership
|
ndarray
|
1D array of ownership |
required |
base
|
int
|
the logarithm base, default 3 |
3
|
boost
|
int
|
the constant to boost low-owned players |
2
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: 1D array of penalties |
TODO: implement this method
Source code in pangadfs/penalty.py
OwnershipPenalty()
¶
Bases: PenaltyBase
Source code in pangadfs/base.py
penalty(*, ownership, base=3, boost=2)
¶
Calculates penalties that are inverse to projected ownership
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ownership
|
ndarray
|
1D array of ownership |
required |
base
|
int
|
the logarithm base, default 3 |
3
|
boost
|
int
|
the constant to boost low-owned players |
2
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: 1D array of penalties |