Skip to content

Improve exception msg by adding column name #5232

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

Merged
merged 5 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
change to overflow exception and add comments
  • Loading branch information
wangyems committed Jun 17, 2020
commit bd482e6ae30ba4af4aea543e478f5dde69c9269a
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Data/Transforms/KeyToVector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public Mapper(KeyToVectorMappingTransformer parent, DataViewSchema inputSchema)
_types[i] = new VectorDataViewType(NumberDataViewType.Single, valueCount, keyCount);
}
}
catch (Exception e)
catch (OverflowException e)
{
var errorMsg = e.Message + " Related column: ";
foreach (var info in _infos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ public void KeyToVectorOverflowTest()
{
// This test is introduced for https://github.com/dotnet/machinelearning/issues/5211
// that provides users an informational exception message
// This exception happens if call OneHotHashEncoding twice in your pipeline
MLContext mlContext = new MLContext(1);

IDataView dataview = mlContext.Data.LoadFromEnumerable(GetData());
Expand Down