我正在构建一个从Dataframe中提取功能的ml管道,我希望它的行为如下:
日志“提取特征1”
提取特征1
日志“提取特征2”
提取特征2
...
日志“提取特征n”
提取特征n
问题是,由于懒惰,我最终得出以下结论:
日志“提取特征1”
日志“提取特征2”
日志“提取特征n”
提取特征1
提取特征2
...
提取特征n
我的转换方法看起来有点像:
override def transform(dataset: DataFrame): DataFrame = {
require(featuresToExtract.size > 0, "You must provide at least one feature to extract to use this FeatureExtractorTransformer")
var joinedDataFrame = extract(dataset, featuresToExtract head)
for (featureToExtract <- featuresToExtract.tail) {
// LOGGING HERE THAT I WANT CALLED JUST BEFORE THE CORRESPONDING ACTION
joinedDataFrame = joinedDataFrame.join(extract(dataset, featureToExtract), joinOn, "outer")
}
joinedDataFrame
}
你知道怎么做吗?
谢谢
暂无答案!
目前还没有任何答案,快来回答吧!