spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jimmy McErlain <ji...@sellpoints.com>
Subject Print Decision Tree Models
Date Wed, 01 Oct 2014 21:13:28 GMT
So I am trying to print the model output from MLlib however I am only
getting things like the following:

org.apache.spark.mllib.tree.model.DecisionTreeModel@1120c600

0.17171527904439082
0.8282847209556092
5273125.0
2.5435412E7


from the following code:

      val trainErr = labelAndPreds.filter(r => r._1 !=
r._2).count.toDouble / cleanedData2.count
      val trainSucc = labelAndPreds.filter(r => r._1 ==
r._2).count.toDouble / cleanedData2.count
      val trainErrCount = labelAndPreds.filter(r => r._1 != r._2).count.toDouble
      val trainSuccCount = labelAndPreds.filter(r => r._1 ==
r._2).count.toDouble

      print(model)
      println(trainErr)
      println(trainSucc)
      println(trainErrCount)
      println(trainSuccCount)


I have also tried the following:

      val model_string = model.toString()
      print(model_string)


And I still do not get the model to print but where it resides in memory.


Thanks,

J







*JIMMY MCERLAIN*

DATA SCIENTIST (NERD)

*. . . . . . . . . . . . . . . . . .*


*IF WE CAN’T DOUBLE YOUR SALES,*



*ONE OF US IS IN THE WRONG BUSINESS.*

*E*: jimmy@sellpoints.com

*M*: *510.303.7751*
ᐧ

Mime
View raw message