-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrcode.html
139 lines (125 loc) · 7.54 KB
/
rcode.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE HTML>
<!--
Massively by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>What Attributes Cause NFL Wide Recievers to be Targeted</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<body class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header">
<a href="index.html" class="logo">Christian Dalton</a>
</header>
<!-- Nav -->
<nav id="nav">
<ul class="links">
<li><a href="index.html">About Me</a></li>
<li class="active"><a href="rcode.html">R</a></li>
<li><a href="sql.html">SQL</a></li>
<!-- <li><a href="tableau.html">Tableau</a></li> -->
<li><a href="python.html">Python</a></li>
<!-- <li><a href="excel.html">Excel</a></li> -->
</ul>
<ul class="icons">
<li><a href="https://www.kaggle.com/christiandalton" target = "_blank" class="icon brands fa-kaggle"><span class="label">Kaggle</span></a></li>
<li><a href="https://www.linkedin.com/in/christian-dalton-baa572178/" target = "_blank" class="icon brands fa-linkedin"><span class="label">Linkedin</span></a></li>
<li><a href="https://github.com/christian-dalton" target = "_blank" class="icon brands fa-github"><span class="label">GitHub</span></a></li>
<li><a href="https://twitter.com/cdalton09" target = "_blank" class="icon brands fa-twitter"><span class="label">Twitter</span></a></li>
</ul>
</nav>
<!-- Main -->
<div id="main">
<!-- Post -->
<section class="post">
<header class="major">
<h1>What Attributes Cause NFL Wide Recievers to be Targeted?</h1>
<p>Using nflfastR's play-by-play data this project takes an exploratory analysis
on the relationship between receiver targets and other recorded variables.
Then, if any of the recorded variables are major factors in what causes a
player to be targeted.</p>
</header>
<h3>Project Objective</h3>
<p>What metrics in nflfastR are predictive of a wide receiver on field value?
Or in other words, which metrics recorded in nflfastR’s play-by-play data
can be used to predict the number of targets a wide receiver will get during
an NFL season? </p>
<h3>Research Methodology</h3>
<p>I converted the nflfastR’s play-by-play data into season totals for all the players using a
fore loop. Then the players were then filtered out by receiving EPA (a metric only recorded for receivers)
to isolate that position group. Players with fewer 10% of the team’s targets were removed
from the dataset to remove noise. Finally, all the data was adjusted to be on a per target basis
and normalized to be between 0-1 so as to not skew the model. </p>
<p>All the machine learning models used k-fold cross validation, where the data was split up
into 5 different groups. The data then was rotated in with the formula 4 training, 1 testing.
This was repeated three times in each model, where the average of each model iteration was
taken to get the final results. The models we ran the data through was Linear Regression,
TreeBagging, Bayes GLM, and Neural Network. </p>
<p>To determine which model was best we used the root mean square error (RMSE),
mean adjusted error (MAE), and R squared (R^2). The priority on deciding the best model was
first on R squared, then on the mean adjusted error, and finally the mean adjusted error.
The best model then was used to predict the number of targets that a receiver should receive
based off its training tuning. The predictions column and the target column were then stored in a
data frame along with the player id, player name and player season. To evaluate the models, the
absolute value of the difference between the targets and prediction columns were taken and stored
into a new column. If the value was within plus or minus 7.5 of the actual targets, it was scored
with a one. Labeling it a success. If it was outside of plus or minus ten it was labeled a failure.
The model was then given a score based off its total accuracy rate.</p>
<h3>Research Findings</h3>
<p>The most predictive statistic in determining the success is Receiving Expected Points Added
(Receiving EPA). An individual players EPA is the sum of a players Expected Points (EP).
“EPA is the difference between the EP at the start of a play and the EP at the end of the play”
-advancedfootballanalytics.com. Even when adjusting for total receiving plays where they impacted
value by being targeted (Receiving EPA / Targets) it still accounts for 87.5% of the best model's
R squared (TreeBagging model).</p>
<h3>Research Weaknesses and Limitations</h3>
<p>Choosing Targets may not necessarily be the best metric in deciding WR value. From a Quarterback or play
calling perspective, targets may indictive of which player the team values over the course of a season.
However, in the analytics community value would be better identified as a metric such as EPA. Using that
as the dependent variable is another way to look at value. In addition, Player Salary would be the teams
perception of expected value, and would hold another solid case for value in creating a model as it is a
statement of value, even if it is likely strongly tied to their past performance and free agency market.
However, Salary was not recorded in nflfastR and for the purpose of this analysis I wanted to keep the
scope within nflfastR's data.
</p>
<ul class="actions special">
<li><a href="https://www.kaggle.com/christiandalton/nfl-wide-receiver-value-analysis/" target = "_blank" class="button">Code Link</a></li>
</ul>
</section>
</div>
<!-- Footer -->
<footer id="footer">
<section class="split contact">
<section>
<h3>Social</h3>
<ul class="icons alt">
<li><a href="https://www.kaggle.com/christiandalton" target = "_blank" class="icon brands alt fa-kaggle"><span class="label">Kaggle</span></a></li>
<li><a href="https://www.linkedin.com/in/christian-dalton-baa572178/" target = "_blank" class="icon brands alt fa-linkedin"><span class="label">Linkedin</span></a></li>
<li><a href="https://github.com/christian-dalton" target = "_blank" class="icon brands alt fa-github"><span class="label">GitHub</span></a></li>
<li><a href="https://twitter.com/cdalton09" target = "_blank" class="icon brands alt fa-twitter"><span class="label">Twitter</span></a></li>
</ul>
</section>
</section>
</footer>
<!-- Copyright -->
<div id="copyright">
</div>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>