0
$\begingroup$

I am working with MLB data with around 15000 observations for seasonal player stat. The data frame's structure looks like this (I'm making up the stats):

player_id  season   age   BA    OBP   SLG  Run  RBI  HR  BABIP   wOBA  wRC+   WAR  BA.y  OBP.y  SLG.y  Run.y  RBI.y  HR.y  BABIP.y wOBA.y  wRC+.y   WAR.y
023841      2014    28   .287  .383  .415  79   76   24  .302    .334   112   2.7  .304  .418   .478   112    106    36    .349    .382     177      6.7

The .y stats represent the players stats in season n+1. My goal is to build a model that projects season n+x performance for player A given his performance stats in year n. I would use the nth season's statistics as independent variables and n+1st year as dependent variables.

My logic behind wanting to use knn is to identify most similar k seasons for the players most recent season (including age as a variable), and base future predictions on how the similar performers played the next year. Should I create a regression model for each of the stats I want to predict or is there a method in R that would allow me to build a multivariate multiple knn regression model? If you think KNN is not the best choice in this case, what else would you recommend?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.