title: how to new DMatrix for XGBoost4J in Spark
body: <p>I have a RDD, which element is ml.dmlc.xgboost4j.LabeledPoint, like</p>
  
  <pre><code>org.apache.spark.rdd.RDD[ml.dmlc.xgboost4j.LabeledPoint]
  </code></pre>
  
  <p>The function XGBoost.train needs DMatrix for training Data, I check out the xgboost source code and find a constructor function for DMatrix, likes that DMatrix(Iterator iter, String cacheInfo).
  <a href="http://dmlc.ml/docs/javadocs/ml/dmlc/xgboost4j/java/DMatrix.html" rel="nofollow noreferrer">DMatrix API</a></p>
  
  <p>However, I have no idea to construct Iterator for DMatrix.</p>
  
  <p>Any solutions?</p>
  
  <p>Besides: I can only use xgboost4j -v0.5 in spark1.5, so some functions in new versions can not use.</p>