salesforce / TransmogrifAI

TransmogrifAI (pronounced trăns-mŏgˈrə-fī) is an AutoML library for building modular, reusable, strongly typed machine learning workflows on Apache Spark with minimal hand-tuning
https://transmogrif.ai
BSD 3-Clause "New" or "Revised" License
2.24k stars 392 forks source link

Get/set output name of stage #431

Closed DLT1412 closed 4 years ago

DLT1412 commented 4 years ago

How to get output name of stage, or set output column like setOutputCol in spark transformer/estimator.

tovbinm commented 4 years ago

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'