jsoma / data-studio-projects

12 stars 18 forks source link

Setting LeBron's performance bar in L.A. #227

Open mattrehbein opened 6 years ago

mattrehbein commented 6 years ago

Pitch

LeBron James announced earlier this month that he has decided to leave his hometown Cleveland Cavaliers (again) and sign with the L.A. Lakers. I thought it'd be interesting to look at how other/past NBA stars fared after leaving their teams while at a similar point in their careers.

Details

I plan to look at and graph in some form performance stats for five players while they were with their original team and then how their numbers did after they moved. I'm looking at players who were about the same age and skill level to try to compare apples to apples.

Because skill level is hard to compare in LeBron's case, one of the five players I plan to look at is Michael Jordan (who was actually the same age LeBron is now when he returned to the Bulls after his brief stab at baseball). Another of the five players I plan to look at is LeBron himself, since he has already changed teams twice (to MIA, then returning to CLE) while playing at a high level.

Possible headline(s): Setting the bar for LeBron in L.A.

Data set(s): NBA Advanced Stats

Code repository: https://github.com/mattrehbein/data_studio/tree/master/code/04-project

Possible problems/fears/questions: I like basketball a lot, but I don't have a particularly sophisticated or high-level knowledge of the sport, so may end up being really challenging putting something meaningful together. My biggest concern right now is deciding on the best way to visualize the data, which I have scraped and started cleaning but haven't graphed yet. Below are a few simple graphs I found online, but I'm still looking for something that really grabs me. I have lots of player stats, but the challenge will be combining them.

Work so far

I have scraped the data and run some basic analysis in pandas. Here's what I'm thinking so far graph-wise. I'm also thinking of putting a couple horizontal bar graphs side-by-side for an individual player, with one side showing what they did with their original team, the other showing how they fared after the move. image image

Checklist

This checklist must be completed before you submit your draft.

pasiegrist commented 6 years ago

I love the idea, as I am a big fan of statistics in sports. But honestly, I have no Idea how you could graph this in a nice looking way without using bar charts. So sorry for that, I can't help you here. But: You mentioned that you want to compare him to similar players. Maybe this project pitch comes to early in our curriculum as we are going to do machine learning and predictions. Maybe you could run simulations with a huge NBA-Dataset that predicts his performance next season? I am sure Jonathan Stray would help you with that – and I think it would be more appealing than just comparing it to Michael Jordan and younger LeBron. But of course, it would be demanding.

If I were you, I would spend some time looking at the stuff 538 does, if you haven't already to get some inspiration.

image

nickospi commented 6 years ago

I haven't looked at your set but I think I would go with the polar chart. It makes sense when having different stats per player: https://matplotlib.org/gallery/pie_and_polar_charts/polar_bar.html#sphx-glr-gallery-pie-and-polar-charts-polar-bar-py.The predictive algorithm @pasiegrist mentions would be super interesting but challenging. Very interesting project, can't wait to see how it turns out, algorithm or no!

mattrehbein commented 6 years ago

Wow -- I love that polar chart!! Working on it!!

mattrehbein commented 6 years ago

Update

Your project content: images/words/etc

lebron_mj_bar_compare

Any changes in direction or topic?

Yes -- to get the most out of the project design-wise, I will likely limit my work over the rest of the week to getting the LeBron and Jordan comparison in the best shape I can. That's a shift as Jordan didn't change teams but was returning from a year+ retirement from basketball. I still plan to make some graphs similar to what I have now that will compare the players with themselves -- how they did before leaving the team/before retiring vs how they did when they went to new team/returned from retirement. I figure if I can get the code/layout in good shape, I can simply scrape new player stats and plug them into what I've got if I do more with this project in future.

Problems/Questions

Figuring out the best type of graph is still very difficult for me. A challenge here too was combining numbers of a wide range (total points per season in the 2,000+ range, most other stats in the low 100s). I added columns to my df calculating season averages, which seem to make the scale a bit more managable.

I'm still playing around with other graph types, like a line graph. I'm thinking that if I do that, I'll be showing some metric (probably point total or points per game avg) over time.

Checklist

sarahslo commented 6 years ago

could you do these as 3-point radial graphs? and put the years on top of each other...? screen shot 2018-08-07 at 8 57 48 pm

mattrehbein commented 6 years ago

Final

Project visuals/text

Earlier this summer, at the age of 33, LeBron James announced that he had signed a four-year deal with the Los Angeles Lakers. The move ended months of speculation and confirmed that LeBron was leaving his hometown of Cleveland for a second time.

To try to gauge whether we should expect King James's numbers to slide with the change in venue, I thought it'd be interesting to take a look at his numbers the last time he swapped clubs. And I wanted to see how he compares with the man he's most often compared with from a historical perspective -- Michael Jordan, who re-emerged from his first retirement in 1995 at the same age LeBron is now.

Let's start by comparing LeBron's numbers from the last three of his four years as a member of the Miami Heat (left) to the first three years of his second tenure in Cleveland (right).

(FULL TEXT IS ON THE WEB PAGE, BUT HERE ARE MY THREE FINAL GRAPHS)

image

image

image

Details

I still love the look of the radial graphs Sarah and Nick recommended, and think they would have been more interesting to look at. I spent a lot of time this week trying to make them (notebooks are in code depository), but I ran out of time before I could make them work.

Headline: Setting the bar for LeBron in L.A.

Published website version: https://mattrehbein.github.io/LeBron/

Code repository: https://github.com/mattrehbein/data_studio/tree/master/code/04-project

Final data set(s): Same as before: NBA Advanced Stats

What did you find to be the most difficult part of this project?

Trying to figure out 3-point radial charts.

Are you satisfied with what you produced? Is there anything you would like to change or improve?

Eh. As usual, working on the viz is very time consuming, since it's still pretty new to me, and I wish I'd have been able to dedicate more time to developing smarter analysis.

Checklist