Skip to content

Refactor update pass quality #481

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jdabapo
Copy link
Contributor

@jdabapo jdabapo commented Mar 22, 2025

update pass quality. notes r in the commit, ill take them out later

Comment on lines 2117 to 2118
However, what if a pass comes from a 'bad' passer? Or what if the pass is from a 'great' passer, but external factors
(such as the pass being contested) make the pass less effective? We will set the lower bound to -2.5% for now, and 4% for the upper bound.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need to consider this? Obviously that's how it happens IRL, but when you're just looking at text play-by-play you're never going to notice if this pass gave a 4% bonus but the next one gave a 2% bonus. You would only maybe slightly notice the bonus in overall season stats and team performance being slightly better. But that'd look the same as if both passes had a 3% bonus.

For stuff like that, where it's something realistic but not noticeable in the game, I tend towards just leaving it out of the simulation. Makes things faster and simpler!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! took your suggestions here and removed some of the complexity for this function. Now its just a flat -0.015 - 0.03, with the passingAtr divided by 5000, so that a 100 passAtr would give 2%, 50 would be 1%, and this is added onto the random number generated between the range

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am skeptical we even need the random number. Nobody will notice that either. Just make it scale compositeRating.passing between those limits. Then the only thing to do would be testing to make sure it didn't change stats too much, but I can do that.

Besides this, do you think this is done? I should proceed with testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, id classify this as done! I scale it now between the limits. I think the only thing that needs to be checked is if this somehow makes the shot prob negative or positive

Comment on lines 2113 to 2116
/*
We want the % chance for better shot to be a higher number, as there are ~ 1.5-2 AST/TOV ratio for NBA teams
https://www.basketball-reference.com/leagues/NBA_2025.html#per_game-team
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace this comment with a quick explanation (doesn't have to be any longer than what you have already) about the effect of pass quality on FG%, including some source ideally? On Discord you linked to https://www.nba.com/stats/players/passing?dir=D&sort=POTENTIAL_AST but like where are you getting the (-0.015, 0.03) range from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I only did a few players on this list and it averaged to about a 4% increase, but as I did more on the list, it jumps up to about 7%. I don't know if 7% seems like a bit too high of a number? And the -0.015, that isn't as easy of a percentage to calculate since this same calculation won't hold with worse passers, since the sample size would be lower

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I see. What is league average, can you do that? Or per team average, does it vary much?

I'll have to do some testing to see, but it could be that we also need to decrease the FG% for non-assisted shots to compensate.

Copy link
Contributor Author

@jdabapo jdabapo Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ill send you the google sheet I made over discord. I took the player with the highest assist number on the team and used it for my sample. The numbers ranged from 3%-16%, with an average of ~9.71%. Take this as you will, not entirely sure that my methodology was the best for determining the bounds... I could also take the second highest player for each team and then see if this formula holds?

Some other interesting stuff, was the best passers didn't necessarily have the highest conversion rate, and it seems that big men have higher conversion rates overall?

@dumbmatter
Copy link
Member

dumbmatter commented Apr 6, 2025

Copying some stuff I told you on Discord just to keep everything about this PR in one place...

one problem with that methodology (determining magnitude of FG% increase from a pass by comparing total assists and potential assists vs overall FG%) is it doesn't normalize for shot type/quality. like maybe 20% of non-assisted shots are layups, but 30% of assisted shots are layups. that should be modeled differently than if it's just based on openness, like if the % of different shot types is the same but assisted shots tend to be more open. if it's openness, then your PR represents that well. but if it's shot type, it doesn't

but, still might be better than nothing..

on the other hand... the "synergy" stuff in game sim code already handles the effect of having good passers, and it does that both by adjusting the distribution of shot types and adjusting the FG%. that's might do good enough to model reality. like you might see similar stats in BBGM about assisted vs non-assisted, just because good passers lead to better shots and good passers tend to produce more assists (probAst).

so overall i think it's unclear if further adjustment is needed, and if it is needed it's unclear if this PR is exactly what's needed

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

Successfully merging this pull request may close these issues.

2 participants