title: Add a column to DataFrame with value of 1 where prediction greater than a custom threshold
body: <p>I am trying to add a column to a <code>DataFrame</code> that should have the value 1 when the output class probability is high. Something like this:</p>
  
  <pre><code>val output = predictions
      .withColumn(
          "easy", 
          when( $"label" === $"prediction" &amp;&amp; 
                $"probability" &gt; 0.95, 1).otherwise(0)
      )
  </code></pre>
  
  <p>The problem is, <code>probability</code> is a <code>Vector</code>, and <code>0.95</code> is a <code>Double</code>, so the above doesn't work.  What I really need is more like <code>max($"probability") &gt; 0.95</code> but of course that doesn't work either.</p>
  
  <p>What is the right way of accomplishing this?</p>