[ 
https://issues.apache.org/jira/browse/SPARK-9963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14746813#comment-14746813
 ] 

Luvsandondov Lkhamsuren commented on SPARK-9963:
------------------------------------------------

Implementing 
{code:title=Node.scala|borderStyle=solid}
def predictImpl(binnedFeatures: Array[Int], splits: Array[Array[Split]])
{code}
then using it inside:
{code:title=RandomForest.scala|borderStyle=solid}
    def binSeqOp(
        agg: Array[DTStatsAggregator],
        baggedPoint: BaggedPoint[TreePoint]): Array[DTStatsAggregator] = {
      treeToNodeToIndexInfo.foreach { case (treeIndex, nodeIndexToInfo) =>
        val node = 
topNodes(treeIndex).toNode.predictImpl(baggedPoint.datum.binnedFeatures, splits)
        nodeBinSeqOp(treeIndex, nodeIndexToInfo.getOrElse(node.id, null), agg, 
baggedPoint)
      }
      agg
    }
{code}

We need to extract the nodeIndex to retrieve the relevant NodeIndexInfo from  
treeToNodeToIndexInfo. Any insights on how I might be able to get around 
getting nodeIndex in this case?

> ML RandomForest cleanup: replace predictNodeIndex with predictImpl
> ------------------------------------------------------------------
>
>                 Key: SPARK-9963
>                 URL: https://issues.apache.org/jira/browse/SPARK-9963
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML
>            Reporter: Joseph K. Bradley
>            Priority: Trivial
>              Labels: starter
>
> Replace ml.tree.impl.RandomForest.predictNodeIndex with Node.predictImpl.
> This should be straightforward, but please ping me if anything is unclear.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to