title: What dos this Ruby statement mean?
body: <p>The code below comes from the documentation for the Ruby Gem rroc. I desperately need to calculate the AUC for my AI project.  However I have virtually no knowledge of Ruby file I/O, not having had occasion to learn. The documentation says rroc expects an n by 2 array but the first line of code below suggest that the data is in a csv file and it will be formatted into my_data for roc to calculate the auc.</p>
  
  <p>I have tried every conceivable combination of csv data and arrays as both files for the first line to read or direct input into the line calculating auc. At best the code works, without error but gives a useless output of 0.  My hope is that if I had a fuller understand of what that line does, I could either fix the problem or give up on the gem since a previous version of this gem was shown to be obsolete and this one's 8 years old. I took the data from the article referenced by the gem author and am pretty sure it's not the problem, but then,...</p>
  
  <p>So, to refine the question: from that statement, can we tell what kind of data should be in 'some_data.cvs'? And what will be done to it to make my_data?</p>
  
  <pre><code>require 'rroc'
  
  my_data = open('some_data.csv').readlines.collect { |l| l.strip.split(",").map(&amp;:to_f) }
  auc = ROC.auc(my_data)
  puts auc
  </code></pre>
  
  <p>Below I've copied the output for two runs, the first with array data read in, the second with csv values (each in separate files). I added a line to read out the input file just to be sure.</p>
  
  <pre><code>RoyiMac:ruby $ ruby PDaucT.rb
  [[90, 1], [80, 1], [70,-1], [60,1], [55,1], [54,1], [53,-1], [52,-1], [51,1], [50,-1], [40,1], [39,-1], [38,1], [37,-1], [36,-1], [35,-1], [34,1], [33,-1], [30,1], [10,-1]] 
  
  0.0
  RoyiMac:ruby $ ruby PDaucT.rb
  90,1,80,1,70,-1,60,1,55,1,54,1,53,-1,52,-1,51,1,50,-1,40,1,39,-1,38,1,37,-1,36,-1,35,-1,34,1,33,-1,30,1,10,-1
  
  0.0
  </code></pre>