[ https://issues.apache.org/jira/browse/SPARK-14585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon resolved SPARK-14585. ---------------------------------- Resolution: Incomplete > Provide accessor methods for Pipeline stages > -------------------------------------------- > > Key: SPARK-14585 > URL: https://issues.apache.org/jira/browse/SPARK-14585 > Project: Spark > Issue Type: New Feature > Components: ML > Reporter: Joseph K. Bradley > Priority: Major > Labels: bulk-closed > > It is currently hard to access particular stages in a Pipeline or > PipelineModel. Some accessor methods would help. > Scala: > {code} > class Pipeline { > /** Returns stage at index i in Pipeline */ > def getStage[T <: PipelineStage](i: Int): T > /** Returns all stages of this type */ > def getStagesOfType[T <: PipelineStage]: Array[T] > } > class PipelineModel { > /** Returns stage at index i in PipelineModel */ > def getStage[T <: Transformer](i: Int): T > /** > * Returns stage given its parent or generating instance in PipelineModel. > * E.g., if this PipelineModel was created from a Pipeline containing a > stage > * {{myStage}}, then passing {{myStage}} to this method will return the > * corresponding stage in this PipelineModel. > */ > def getStage[T <: Transformer][implicit E <: PipelineStage](stage: E): T > /** Returns all stages of this type */ > def getStagesOfType[T <: Transformer]: Array[T] > } > {code} > These methods should not be recursive for now. I.e., if a Pipeline A > contains another Pipeline B, then calling {{getStage}} on the outer Pipeline > A should not search for the stage within Pipeline B. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org