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

Schema mismatch for label column ': expected Boolean, got Single #7153

Open
robalexclark opened this issue May 16, 2024 · 0 comments
Open

Schema mismatch for label column ': expected Boolean, got Single #7153

robalexclark opened this issue May 16, 2024 · 0 comments
Labels
untriaged New issue has not been triaged

Comments

@robalexclark
Copy link

I have an AutoML experiment as follows:

     List<QuoteModel> quoteModels = new List<QuoteModel>();

   //...get data from db and load into quoteModels

     MLContext mlContext = new MLContext();

     IDataView dataView = mlContext.Data.LoadFromEnumerable(quoteModels);
     TrainTestData splitDataView = mlContext.Data.TrainTestSplit(dataView, testFraction: 0.8);

     SweepablePipeline pipeline = mlContext.Auto().Featurizer(
         dataView)
         .Append(mlContext.Auto().BinaryClassification(labelColumnName: "LeadWon", featureColumnName: "PreviouslyFlooded"));

     AutoMLExperiment experiment = mlContext.Auto().CreateExperiment();

     experiment
         .SetPipeline(pipeline)
         .SetBinaryClassificationMetric(BinaryClassificationMetric.Accuracy, labelColumn: "LeadWon")
         .SetTrainingTimeInSeconds(60)
         .SetDataset(splitDataView);

     TrialResult experimentResults = await experiment.RunAsync();

The QuoteModel class is:


public class QuoteModel
{
    public string PreviouslyFlooded { get; set; }

    public Boolean LeadWon { get; set; }
}

When I run the experiment it gives the error:

System.ArgumentOutOfRangeException: 'Schema mismatch for label column 'LeadWon': expected Boolean, got Single

If you look at the QuoteModel class, the label column LeadWon is definately a boolean!!

Any ideas why/how it can give this seemingly impossible error?

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

1 participant