[ https://issues.apache.org/jira/browse/SPARK-20271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon updated SPARK-20271: --------------------------------- Labels: bulk-closed (was: ) > Add FuncTransformer to simplify custom transformer creation > ----------------------------------------------------------- > > Key: SPARK-20271 > URL: https://issues.apache.org/jira/browse/SPARK-20271 > Project: Spark > Issue Type: New Feature > Components: ML > Affects Versions: 2.2.0 > Reporter: yuhao yang > Priority: Major > Labels: bulk-closed > > Just to share some code I implemented to help easily create a custom > Transformer in one line of code w. > {code} val labelConverter = new FuncTransformer((i: Double) => if (i >= 1) 1 > else 0) {code} > This was used in many of my projects and is pretty helpful (Maybe I'm > lazy..). The transformer can be saved/loaded as other transformer and can be > integrated into a pipeline normally. It can be used widely in many use cases > like conditional conversion(if...else...), , type conversion, to/from Array, > to/from Vector and many string ops.. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org