Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player position availability update? #182

Open
rickenrocker24 opened this issue Nov 3, 2021 · 8 comments
Open

player position availability update? #182

rickenrocker24 opened this issue Nov 3, 2021 · 8 comments

Comments

@rickenrocker24
Copy link

Fanduel made changes this season for player position availability

@rickenrocker24
Copy link
Author

Any updates on the UTL position

@BenBrostoff
Copy link
Owner

Yo! I think this could be easily done if you send me a CSV or just example of what a lineup looks like - I haven't been playing FanDuel much over the last two years so have fallen out of touch with what this format looks like. Let me know and I think this is easy-ish to do.

@rickenrocker24
Copy link
Author

Thanks for your prompt response @BenBrostoff below is an example of the fanduel mlb lineup construction...basically they added the "UTIL" position at the bottom and now players can have multiple position. Example below...

image

@BenBrostoff
Copy link
Owner

Ah gotcha, let me see what I can do here

@BenBrostoff
Copy link
Owner

Was taking a look here - what's the current issue with how this is implemented? I see FD_MLB_RULE_SET allows for 9 players and you can have 2 of any non pitcher. Is it how CSVs are parsed / what's a specific example of where you're seeing this not working?

Snippet on what I'm seeing:

>>> from draftfast import rules
>>> rules.FD_MLB_RULE_SET
<draftfast.rules.RuleSet object at 0x7f7b901a5d00>
>>> vars(_)
{'site': 'FAN_DUEL', 'league': 'MLB', 'roster_size': 9, 'position_limits': [['P', 1, 1], ['1B', 1, 2], ['2B', 1, 2], ['3B', 1, 2], ['SS', 1, 2], ['OF', 3, 4]], 'general_position_limits': [], 'salary_min': 0, 'salary_max': 35000, 'offensive_positions': None, 'defensive_positions': None, 'game_type': 'classic', 'max_players_per_team': 8, 'position_per_team_rules': None, 'min_teams': None}

@rickenrocker24
Copy link
Author

I've attached samples of projections and salary(from FD) I used, when entering the lineup in fanduel it does not lineup and I would need to move players around to make it fit in some cases.

MLB_SALS.csv
MLB_PROJECTIONS.csv

image

image

usage:

from os import environ
from draftfast import rules
from draftfast.optimize import run_multi
from draftfast.csv_parse import salary_download, uploaders

"""
Script to create 3 mlb lineups for Fanduel.

Assumptions:

  • Environment variable called "downloads" has path to downloads
  • In downloads, salary, projection and player ID files exist with
    the filenames listed in the script.
    """

players = salary_download.generate_players_from_csvs(
salary_file_location='./MLB_SALS.csv',
projection_file_location='./MLB_PROJECTIONS.csv',
game=rules.FAN_DUEL,
)

rosters, _ = run_multi(
iterations=3,
exposure_bounds=[
#{
# 'name': 'Freddy Peralta',
# 'min': 0.1,
# 'max': 0.5,
#},
#{
# 'name': 'Shane Bieber',
# 'min': 0.1,
# 'max': 0.5,
#
#,
],
rule_set=rules.FD_MLB_RULE_SET,
player_pool=players,
verbose=True,
)

@BenBrostoff
Copy link
Owner

BenBrostoff commented Oct 11, 2022 via email

@rickenrocker24
Copy link
Author

Miranda. So if I were to put Miranda on 3B (since C/1B is taken by will smith), then Flores would go to 2B but know Ryan McMahon (3B) will not fit into the roster.

Players now can have multiple positions and Fanduel has a UTIL (like a FLEX position) position which can be any position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants