Skip to content

Improve usability of AutoML column not found error #5574

Closed

Description

@justinormont

Let's make the error message more actionable.

Error user sees:
image

I would recommend adding similar named column(s):

- $"Provided {columnPurpose} column '{columnName}' not found in training data."
+ $"Provided {columnPurpose} column '{columnName}' not found in training data. Did you mean '{closestNamed}'."

For my current example, this would print: Provided ignored column 'tagMaxTotalItem' not found in training data. Did you mean 'tagMaxTotalItems'.

I'd recommend using Levenshtein distance to find the closest named column (code).

Code location:

var nullableColumn = trainData.Schema.GetColumnOrNull(columnName);
if (nullableColumn == null)
{
throw new ArgumentException($"Provided {columnPurpose} column '{columnName}' not found in training data.");
}

Background:
It took me ~20min to debug why this error was occurring (obvious in retrospect). My column existed in the dataset, it existed in my loader function, it existed in my IDataView, ...; simply was just misspelt ("tagMaxTotalItem" instead of "tagMaxTotalItems").

Improving the usability of this error message will save future users' time.

Activity

  1. behroozbc commented on Jul 24, 2021

    @behroozbc

    hi
    Is this issue solved ??

  2. woodya-coder commented on Aug 2, 2021

    @woodya-coder

    I was going to try working on this as my first contribution to open source, but it looks already fixed to me in the code. I don't see a test for it though. I could add a test to confirm it. I haven't seen any guidelines on writing tests. Are there any?

  3. michaelgsharp commented on Aug 4, 2021

    @michaelgsharp
    Contributor

    I dont think we have any official guidelines. I would just look at the other tests we have for AutoML and base it off of that. If you can throw the test in to an existing class that would probably be better, but if it doesn't fit anywhere than feel free to make a new test class too.

  4. abhinavjainn412 commented on Aug 21, 2021

    @abhinavjainn412

    We can use sequence matcher ,it compare the column typed by us with the existing columns like this-
    from difflib import SequenceMatcher
    s = SequenceMatcher(None, a, b)
    s.ratio()
    if we find s.ratio() >50 than we will print
    throw new ArgumentException($"Provided {columnPurpose} column '{columnName}' not found in training data. And their may be spelling mistake typed by you");
    so it will help us in identifying such type of bugs.

  5. bhargavsonagara commented on Aug 25, 2021

    @bhargavsonagara

    Actually what we have to do now? I am new to it plz help me and I really want to contribute on any issue .

  6. the-programmer commented on May 22, 2022

    @the-programmer

    Hi, I wanted to try and fix this issue but it seems this issue is already fixed:

    var exceptionMessage = $"Provided {columnPurpose} column '{columnName}' not found in training data.";
    if (closestNamed != string.Empty)
    {
    exceptionMessage += $" Did you mean '{closestNamed}'.";
    }

    Can someone close this?

  7. michaelgsharp commented on Jun 13, 2022

    @michaelgsharp
    Contributor

    Thanks for pointing this out @the-programmer! Closing the issue.

  8. ghost locked as resolved and limited conversation to collaborators on Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersusabilitySmoothing user interaction or experience

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions