O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Iterations

Scala

object GradientBoostedTreesIterations{   def main(args: Array[String]) {     val data = GradientBoostedTreesUtil.getTrainTestData()     val train_data = data._1     val test_data = data._2     val iterations_param = Array(1, 5, 10, 15, 18)     val i = 0     val resultsMap = new scala.collection.mutable.HashMap[         String, String]     val dataset = new DefaultCategoryDataset()     for(i <- 0 until iterations_param.length) {       val iteration = iterations_param(i)       val rmsle = GradientBoostedTreesUtil.evaluate(train_data,          test_data,iteration,maxDepth)       resultsMap.put(iteration.toString,rmsle.toString)       dataset.addValue(rmsle, "RMSLE", iteration)     }     val chart = new LineChart(       "Iterations" ,       "GradientBoostedTrees : RMSLE vs Iterations")  chart.exec("Iterations","RMSLE",dataset) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required