Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new type to key-value converter #6973

Merged
merged 8 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"name": "AddKeyValueAnnotationsAsText",
"type": "boolean",
"default": false
},
{
"name": "KeyData",
"type": "dataView"
}
]
}
6 changes: 4 additions & 2 deletions src/Microsoft.ML.AutoML/CodeGen/search-space-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@
"predictedAnswerColumnName",
"TopKAnswers",
"TargetType",
"PredictionColumnName"
"PredictionColumnName",
"KeyData"
]
},
"option_type": {
Expand All @@ -259,7 +260,8 @@
"dnnModelFactory",
"bertArchitecture",
"imageClassificationArchType",
"dataKind"
"dataKind",
"dataView"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"name": "TargetType",
"type": "dataKind",
"default": "DataKind.Single"
},
{
"name": "KeyData",
"type": "dataView"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal partial class MapValueToKey
{
public override IEstimator<ITransformer> BuildFromOption(MLContext context, MapValueToKeyOption param)
{
return context.Transforms.Conversion.MapValueToKey(param.OutputColumnName, param.InputColumnName, addKeyValueAnnotationsAsText: param.AddKeyValueAnnotationsAsText);
return context.Transforms.Conversion.MapValueToKey(param.OutputColumnName, param.InputColumnName, addKeyValueAnnotationsAsText: param.AddKeyValueAnnotationsAsText, keyData: param.KeyData);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void Execute(GeneratorExecutionContext context)
"bertArchitecture" => "BertArchitecture",
"imageClassificationArchType" => "Microsoft.ML.Vision.ImageClassificationTrainer.Architecture",
"dataKind" => "Microsoft.ML.Data.DataKind",
"dataView" => "Microsoft.ML.IDataView",
_ => throw new ArgumentException("unknown type"),
};

Expand All @@ -76,6 +77,7 @@ public void Execute(GeneratorExecutionContext context)
(_, "BertArchitecture") => defaultToken.GetValue<string>(),
(_, "Microsoft.ML.Vision.ImageClassificationTrainer.Architecture") => defaultToken.GetValue<string>(),
(_, "Microsoft.ML.Data.DataKind") => defaultToken.GetValue<string>(),
(_, "Microsoft.ML.IDataView") => defaultToken.GetValue<string>(),
(_, _) => throw new ArgumentException("unknown"),
};

Expand Down
Loading