AutoML BinaryClassificationExperiment.Execute throws NullReferenceException in ConcatenateEntity.ToString when ColumnInformation names a column the preFeaturizer creates

未关闭
#7,825 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp

调研方向

Start with BinaryClassificationExperiment.CreateBinaryClassificationPipeline and the SweepablePipeline construction path shown in the stack trace. Reproduce with the supplied preFeaturizer and ColumnInformation example, then inspect how the featurizer resolves columns before and after the preFeaturizer. Done means the pipeline handles a generated column or reports the missing column clearly instead of throwing NullReferenceException.

由索引模型根据 Issue 内容生成。

描述

area-AutoML untriaged
System information
  • Microsoft.ML 5.0.1, Microsoft.ML.AutoML 0.23.1
  • .NET 10 (net10.0), macOS arm64
Describe the bug

BinaryClassificationExperiment.Execute(trainData, columnInformation, preFeaturizer) throws a NullReferenceException from ConcatenateEntity.ToString when ColumnInformation names a column that the preFeaturizer creates. It does not report that the column does not exist.

To reproduce
var pre = ml.Transforms.Text.TokenizeIntoCharactersAsKeys("text__chars", "text")
    .Append(ml.Transforms.Text.ProduceNgrams("text__counts", "text__chars", 4));
var info = new ColumnInformation { LabelColumnName = "label" };
info.IgnoredColumnNames.Add("text");
info.NumericColumnNames.Add("text__counts");          // created by the preFeaturizer
ml.Auto().CreateBinaryClassificationExperiment(new BinaryExperimentSettings { MaxExperimentTimeInSeconds = 10 })
  .Execute(train, info, pre);
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.ML.AutoML.ConcatenateEntity.ToString()
   at Microsoft.ML.AutoML.SweepablePipeline..ctor(...)
   at Microsoft.ML.AutoML.SweepablePipeline.AppendEntity(...)
   at Microsoft.ML.AutoML.SweepableExtension.Append(IEstimator`1 estimator, SweepablePipeline pipeline)
   at Microsoft.ML.AutoML.BinaryClassificationExperiment.CreateBinaryClassificationPipeline(IDataView trainData, ColumnInformation columnInformation, IEstimator`1 preFeaturizer)

The featurizer is built from trainData's schema before the preFeaturizer runs, so a column the preFeaturizer adds is not found. If the preFeaturizer writes its output back under an existing column name (for example NormalizeLpNorm("text", …) with "text" listed as numeric), training works.

Expected behavior

One of:

  • the pipeline is built from the preFeaturizer's output schema, so ColumnInformation can name columns the preFeaturizer produces, or
  • Execute fails with a message naming the missing column.
主要语言
C#
星标
9.4k
派生
2k
平均合并
2 天 18 小时
30 天内合并 PR
64

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dotnet/machinelearning 的其他 Issue

查看 dotnet/machinelearning 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。