将 Azure AutoML 与 XGBoost 分类器一起用于分类数据时出现奇怪的算法选择
Strange algorithm selection when using Azure AutoML with XBoostClassifier on categorial data
我有一个仅包含分类特征和分类标签的数据模型。
因此,当我在 XGBoost 中手动构建该模型时,我基本上会将特征转换为二进制列(使用 LabelEncoder 和 OneHotEncoder),并使用 LabelEncoder 将标签转换为 类。然后我会 运行 一个 多标签分类 (multi:softmax)。
我用我的数据集进行了尝试,结果准确度约为 0.4(不幸的是,由于机密性,无法共享数据集)
现在,如果我 运行 在 Azure AutoML 中使用相同的数据集,我最终在最佳实验中的准确度约为 0.85。但真正有趣的是,AutoML 使用了 SparseNormalizer、XGBoostClassifier,其中 reg:logistic 为 objective。
因此,如果我解释正确,AzureML 只是规范化数据(以某种方式来自分类数据?),然后执行逻辑回归?这甚至可能吗/这对分类数据有意义吗?
提前致谢。
TL;DR
你是对的,归一化对于在分类数据上训练梯度提升决策树 (GBDT
s) 没有意义,但它不会产生不利影响。 AutoML 是一个用于建模的自动化框架。作为校准控制的交换,您可以获得易用性。仍然值得首先验证 AutoML 正在接收数据,其中的列正确编码为分类。
将 AutoML 模型视为有效的 sklearn Pipeline, which is a bundled set of pre-processing steps along with a predictive Estimator. AutoML will attempt to sample from a large swath of pre-configured Pipelines such that the most accurate Pipeline will be discovered. As the docs 说:
In every automated machine learning experiment, your data is automatically scaled or normalized to help algorithms perform well. During model training, one of the following scaling or normalization techniques will be applied to each model.
看到这个,你可以在你的拟合模型上调用.named_steps
。另请查看 fitted_model.get_featurization_summary()
我特别理解你的关心,尤其是w.r.t。 AutoML 如何利用 LightGBM
(MSFT 的 GBDT 实现)。 LightGBM
接受分类列,而不是单热编码,每当拆分时将它们分为两个子集。尽管如此,AutoML 将通过单热编码、缩放、and/or 规范化来预处理分类列;因此这种独特的分类方法从未在 AutoML 中使用。
如果您对 Azure ML 中的“手动”ML 感兴趣,我强烈建议您查看 Estimators
and Azure ML Pipelines
我有一个仅包含分类特征和分类标签的数据模型。
因此,当我在 XGBoost 中手动构建该模型时,我基本上会将特征转换为二进制列(使用 LabelEncoder 和 OneHotEncoder),并使用 LabelEncoder 将标签转换为 类。然后我会 运行 一个 多标签分类 (multi:softmax)。 我用我的数据集进行了尝试,结果准确度约为 0.4(不幸的是,由于机密性,无法共享数据集)
现在,如果我 运行 在 Azure AutoML 中使用相同的数据集,我最终在最佳实验中的准确度约为 0.85。但真正有趣的是,AutoML 使用了 SparseNormalizer、XGBoostClassifier,其中 reg:logistic 为 objective。 因此,如果我解释正确,AzureML 只是规范化数据(以某种方式来自分类数据?),然后执行逻辑回归?这甚至可能吗/这对分类数据有意义吗?
提前致谢。
TL;DR
你是对的,归一化对于在分类数据上训练梯度提升决策树 (GBDT
s) 没有意义,但它不会产生不利影响。 AutoML 是一个用于建模的自动化框架。作为校准控制的交换,您可以获得易用性。仍然值得首先验证 AutoML 正在接收数据,其中的列正确编码为分类。
将 AutoML 模型视为有效的 sklearn Pipeline, which is a bundled set of pre-processing steps along with a predictive Estimator. AutoML will attempt to sample from a large swath of pre-configured Pipelines such that the most accurate Pipeline will be discovered. As the docs 说:
In every automated machine learning experiment, your data is automatically scaled or normalized to help algorithms perform well. During model training, one of the following scaling or normalization techniques will be applied to each model.
看到这个,你可以在你的拟合模型上调用.named_steps
。另请查看 fitted_model.get_featurization_summary()
我特别理解你的关心,尤其是w.r.t。 AutoML 如何利用 LightGBM
(MSFT 的 GBDT 实现)。 LightGBM
接受分类列,而不是单热编码,每当拆分时将它们分为两个子集。尽管如此,AutoML 将通过单热编码、缩放、and/or 规范化来预处理分类列;因此这种独特的分类方法从未在 AutoML 中使用。
如果您对 Azure ML 中的“手动”ML 感兴趣,我强烈建议您查看 Estimators
and Azure ML Pipelines