Skip to content

Commit bbae24d

Browse files
committed
concat feature columns addition
1 parent 87fdcda commit bbae24d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Microsoft.ML.AutoML/TransformInference/TransformInference.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public static SuggestedTransform[] InferTransforms(MLContext context, TaskKind t
406406
suggestedTransforms.AddRange(suggestions);
407407
}
408408

409-
if (task != TaskKind.Recommendation && task != TaskKind.Ranking)
409+
if (task != TaskKind.Recommendation)
410410
{
411411
var finalFeaturesConcatTransform = BuildFinalFeaturesConcatTransform(context, suggestedTransforms, intermediateCols);
412412
if (finalFeaturesConcatTransform != null)
@@ -446,6 +446,10 @@ private static SuggestedTransform BuildFinalFeaturesConcatTransform(MLContext co
446446
var labelColumnName = intermediateCols.FirstOrDefault(c => c.Purpose == ColumnPurpose.Label)?.ColumnName;
447447
concatColNames.Remove(labelColumnName);
448448

449+
// remove column with 'GroupId' purpose
450+
var groupColumnName = intermediateCols.FirstOrDefault(c => c.Purpose == ColumnPurpose.GroupId)?.ColumnName;
451+
concatColNames.RemoveAll(s => s == groupColumnName);
452+
449453
intermediateCols = intermediateCols.Where(c => c.Purpose == ColumnPurpose.NumericFeature ||
450454
c.Purpose == ColumnPurpose.CategoricalFeature || c.Purpose == ColumnPurpose.TextFeature ||
451455
c.Purpose == ColumnPurpose.ImagePath);

test/Microsoft.ML.CodeGenerator.Tests/ApprovalTests/ConsoleCodeGeneratorTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public void ConsoleAppModelBuilderCSFileContentRegressionTest()
8383
var result = consoleCodeGen.GenerateConsoleAppProjectContents(_namespaceValue, typeof(float), true, true,
8484
false, false, false, false);
8585

86-
8786
Approvals.Verify(result.modelBuilderCSFileContent);
8887
}
8988

@@ -540,7 +539,6 @@ private CodeGenerator PrepareForRecommendationTask()
540539
{
541540
if (_mockedPipeline == null)
542541
{
543-
544542
MLContext context = new MLContext();
545543
// same learners with different hyperparams
546544
var hyperparams1 = new Microsoft.ML.AutoML.ParameterSet(new List<Microsoft.ML.AutoML.IParameterValue>() { new LongParameterValue("NumLeaves", 2) });

0 commit comments

Comments
 (0)