Get/set output name of stage
DLT1412 opened this issue · 1 comments
DLT1412 commented
How to get output name of stage, or set output column like setOutputCol
in spark transformer/estimator.
tovbinm commented
Each stage sets the output feature name automatically based on it's ID. You can rename the output feature using the alias
shortcut as follows:
val textFeature: FeatureLike[Text] = ???
val tokens: FeatureLike[TextList] = textFeature.tokenize().alias() // the output feature name is 'tokens'
// or pass the feature name explicitly
val tokens: FeatureLike[TextList] = textFeature.tokenize().alias("tokens") // the output feature name is 'tokens'