droher / baseball.computer Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Nuances to handle:
rg -e "PO\d\([3-8]"
I haven't been able to find the root cause of the problem, but I've stumbled across some columns of incorrect data. So far, the most notable example of this I can find is ERA in the metrics_player_career_pitching table. I've provided a quick example below with Terry Adams, but from what I can tell, many (if not all) pitchers have incorrect stats for multiple columns.
Querying some basic data in metrics_player_career_pitching for Terry, this is what gets returned:
Double-checking with baseballreference, Terry did not have a career ERA of 0.64, it was actually 4.17. His strikeouts/9 are also wrong, with an actual value of 7.2, as well as his RA(4.64) and his WHIP (1.46). Notably, all the counting stats seem to be accurate as far as I can tell, but many of the rate stats (or in general, numbers stored as doubles) are off.
enum_lookups:
side: game.game_team
doubleheader_status: game.game
time_of_day: game.game
game_type: game.game
sky: game.game
field_condition: game.game
precipitation: game.game
wind_direction: game.game
entered_game_as: game.game_lineup_appearance
frame: event.event
baserunner: event.event_starting_base_state
baserunning_play_type: event.event_baserunning_play
contact: event.event_batted_ball_info
general_location: event.event_batted_ball_info
depth: event.event_batted_ball_info
angle: event.event_batted_ball_info
strength: event.event_batted_ball_info
fielding_play: event.event_fielding_play
flag: event.event_flag
sequence_item: event.event_pitch
enum_vals:
base: [First, Second, Third, Home]
{% macro add_enums() %}
{% set sql%}
{% for enum, table in var("enum_lookups").items() %}
CREATE TYPE {{ enum }} AS ENUM (SELECT DISTINCT {{ enum }} FROM {{ table }});
{%- endfor %}
{% for node in graph.sources.values() %}
{% for col_name, col_data in node.columns.items() if col_data.get("data_type") %}
ALTER TABLE {{ node.schema }}.{{ node.name }} ALTER COLUMN {{ col_name }} TYPE {{ col_data.data_type }};
{%- endfor %}
{% endfor %}
{% endset %}
{% do log(sql, info=True)%}
{% do run_query(sql) %}
{% endmacro %}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.