You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Joseph K. Bradley (JIRA)" <ji...@apache.org> on 2016/04/28 21:06:12 UTC

[jira] [Updated] (SPARK-14585) Provide accessor methods for Pipeline stages

     [ https://issues.apache.org/jira/browse/SPARK-14585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joseph K. Bradley updated SPARK-14585:
--------------------------------------
    Shepherd: Joseph K. Bradley

> 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
>
> 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
(v6.3.4#6332)

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