jsoslow2 / Fantasy-Football-Models-Old

Beating the shit out of my friends with data science
82 stars 25 forks source link

Unable to Generate Report #4

Open janstadt opened 1 year ago

janstadt commented 1 year ago

Im using the latest R libs and RStudio and i've tried on 2 different macs and a windows box without any luck. On windows it seems to get the furthest, but ends up throwing this error:

label: unnamed-chunk-42
Quitting from lines 2045-2047 (Fantasy-Football-Analysis-v2.Rmd) 
Error in (function (cond)  : 
  error in evaluating the argument 'x' in selecting a method for function 'mean': subscript out of bounds
Calls: <Anonymous> ... eval -> mean -> as.numeric -> is.H2OFrame -> <Anonymous>

It does produce a csv file (dad_ranks.csv) as well as the graph images but fails to complete.

scooberu commented 1 year ago

I see something similar intermittently. What kinds of inputs have you given for draftedOverall? I found that it works for me with no inputs, breaks with 1, and starts working again with more than 1.

scooberu commented 1 year ago

My current theory is that the mean() function is making some bad assumptions in this index: [1:500,1]. But not being an R programmer, I'm a bit stumped by what to do to fix it.

janstadt commented 1 year ago

Hey @gatsbysghost. I havent changed any values from the current file. I see there are a bunch of random player names and teams in the calculations. Are we supposed to remove those or modify them as well?

scooberu commented 1 year ago

That's a great question--part of me thinks they're essentially normalizers/validators for the data (e.g., "well, Jameis Winston should be about the mean value for points, so let's alter the table to reflect that assumption"), but on further examination I'm not so sure. I just removed that whole block with the mean functions and it did change the output CSV a little, but not much--and it also ran to completion. (The different CSV output might also be a result of my having re-run the whole model from top to bottom). So I might recommend just getting rid of them.

scooberu commented 1 year ago

I'd have to defer to @jsoslow2 on their function--again, I'm not really sure they're mutating any data that gets used later, and it seems like they're just gumming up the works when there's a value out of range for the mean() function.

daveashworth commented 1 year ago

I'm actually getting an error when running on line 1620:

Error: Model-specific variable importance scores are currently not available for this type of model.
Execution halted

Running through RStudio Screen Shot 2022-09-23 at 4 47 37 PM

FYI I'm also an R newbie. Any thoughts are appreciated!

scooberu commented 1 year ago

@daveashworth a recent commit fixes this issue (it's just a mis-named variable); pull from main again and you should be good to go!

daveashworth commented 1 year ago

Oh excellent thanks!