almartin82 / projprep Goto Github PK
View Code? Open in Web Editor NEWa R package that helps read, clean up, and convert baseball projection data into auction prices.
a R package that helps read, clean up, and convert baseball projection data into auction prices.
because it doesn't project saves, all save zscores are NaN, which causes lots of problems. fix that.
R CMD check yells about non-ascii characters:
* checking data for non-ASCII characters ... WARNING
Warning: found non-ASCII strings
'Pedro B<c3><a1>ez' in object 'id_map'
'Manny Ba<c3><b1>uelos' in object 'id_map'
'Aar<c3><b3>n Brooks' in object 'id_map'
'Arqu<c3><ad>medes Caminero' in object 'id_map'
this can apparently be solved by adding encoding info.
@chrishaid thought you might find this tidbit about CMD check interesting.
use zach's formula
http://www.fangraphs.com/fantasy/value-above-replacement-part-three/
scrape them
this creates serious inflation, because guys can be kept under their value -- pushes prices up.
it has an expansive player universe and good metadata. add it to the universal_metadata
vignette and the id_map
.
will help sanity check top X by zscore vs top X by consensus rankings
I'm getting the following error message: "Error in names(df)[2] <- "fg_note" :
'names' attribute [2] must be the same length as the vector [1]"
these are stubs right now (ex), but to combine data from multiple projection systems the real mlbids are needed.
for instance, kershaw has negative ERA value. yeah.
per zach sanders: http://www.fangraphs.com/fantasy/basebal-fantasy-value-above-replacement/ pt 3
it's definitely worth something. but what?
per issue #15 (last issue to close for projprep 0.3!), it's important to get positional eligibility right. because I am loathe to do anything manually when it is scriptable, let's pull these down from from the yahoo API.
this seems simple enough - player status is
select * from fantasysports.players where game_key = 357
using yahoo's query language, and that can be wrapped into a RESTful call by hitting
https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20fantasysports.games%20where%20game_key%3D%22357%22&format=json&diagnostics=true&callback=
roughly:
httr
include force_numeric
logic in the cleaning function, similar to cbs
whoops. need to clarify that.
next task is to adjust for replacement-level, per position
https://github.com/almartin82/projection_prep/blob/dc450c07833c1b1e8b26b0c7c8813483fa1a20ea/R/proj_prep.R#L64
eg, per cheatsheet, some projections are good on true talent but bad at getting AB / IP right.
allow users to treat the playing time assumptions from one projection system as source-of-truth.
@drewgriffith15 has some code that does this for 2015:
https://github.com/drewgriffith15/MLB/blob/master/xDraft.R
once we clean up team names, this will be easy enough.
probably many things are going to break. write tests!
to allow users to interactively change the settings used by projprep.
similar to #1, this will help us sanity-check our prices
ie razzball steamer, which has a projection for both matt duffy as a giant and a texan?!
write a data cleaning function to return the projection with more AB/IP.
ie, if you are a yahoo league, apply the yahoo position eligibility, no matter what the projection system thinks.
needs to key off of mlbid.
convert rate stats to counting before zscoring, per luke's point
1/0 is confusing.
another paid_projection parser...
what I thought was an error in the projections for #26 is actually... just how things are going. fangraphs (a reasonably complete but not outlandish projection universe) has 13 name collsions:
table(pos_df$fullname)[table(pos_df$fullname) > 1] %>% sort()
Carlos Perez Carlos Sanchez Christian Vazquez Daniel Robertson
2 2 2 2
Jesus Montero Jose Gonzalez Jose Martinez Juan Perez
2 2 2 2
Matt Duffy Michael Miller Michael Taylor Tanner Murphy
2 2 2 2
Tyler Moore
2
I think our playerid match functions should pre-process these names, and attempt to match on name/team...
per #31, we will likely need to use team names as part of the match criteria. so that means we need to normalize `c('Athletics', 'OAK', ...)
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.