title: Spark: How to transform values of some selected features in LabeledPoint?
body: <p>I've got a <code>LabeledPoint</code> and a list of features that I want to transform:</p>
  
  <pre><code>scala&gt; transformedData.collect()
  res29: Array[org.apache.spark.mllib.regression.LabeledPoint] = Array((0.0,(400036,[7744],[2.0])), (0.0,(400036,[7744,8608],[3.0,3.0])), (0.0,(400036,[7744],[2.0])), (0.0,(400036,[133,218,2162,7460,7744,9567],[1.0,1.0,2.0,1.0,42.0,21.0])), (0.0,(400036,[133,218,1589,2162,2784,2922,3274,6914,7008,7131,7460,8608,9437,9567,199999,200021,200035,200048,200051,200056,200058,200064,200070,200072,200075,200087,400008,400011],[4.0,1.0,6.0,53.0,6.0,1.0,1.0,2.0,11.0,17.0,48.0,3.0,4.0,113.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,28.0,1.0,1.0,1.0,1.0,1.0,4.0])), (0.0,(400036,[1589,3585,4830,6935,6936,7744,400008,400011],[2.0,6.0,3.0,52.0,4.0,3.0,1.0,2.0])), (0.0,(400036,[1589,2162,2784,2922,4123,7008,7131,7792,8608],[23.0,70.0,1.0,2.0,2.0,1.0,1.0,2.0,2.0])), (0.0,(400036,[4830,6935,6936,400008,400011],[1.0,36.0...
  
  val toTransform =  List(124,443,543,211,...
  </code></pre>
  
  <p>Transformation that I want to use looks like this :</p>
  
  <ol>
  <li>Take the natural logarithm of (feature value+1): <code>new_val=log(val+1)</code></li>
  <li>Divide new values by maximum of new values: <code>new_val/max(new_val)</code> (if <code>max</code> not equal to 0)</li>
  </ol>
  
  <p>How can perform this transformation for each <code>feature</code> from my <code>toTransform</code> list (I don't want to create new features, just transform old one)</p>