Skip to content

Different behavior when calling Fit() on a transformer chain and on an IDataLoaderEstimator #2866

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

Closed
yaeldekel opened this issue Mar 6, 2019 · 3 comments
Assignees
Labels
API Issues pertaining the friendly API
Milestone

Comments

@yaeldekel
Copy link

yaeldekel commented Mar 6, 2019

The following code runs without errors:

            var loader = ml.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file);
            var data = loader.Load(file);

            // Pipeline.
            var pipeline = ml.BinaryClassification.Trainers.GeneralizedAdditiveModels();

            // Train.
            var model = pipeline.Fit(data);

However, the following code fails with schema mismatch exception:

            var loader = ml.Data.CreateTextLoader<InputData>(hasHeader: true, dataSample: file);

            // Define the same pipeline starting with the loader.
            var pipeline = loader.Append(ml.BinaryClassification.Trainers.GeneralizedAdditiveModels());

           // Train
            var model = pipeline.Fit(file);

This may also be related to issue #1969 .

@yaeldekel
Copy link
Author

yaeldekel commented Mar 6, 2019

By the way, this is the definition of InputData:

        private class InputData
        {
            [LoadColumn(0)]
            public float Label { get; set; }
            [LoadColumn(9, 14)]
            [VectorType(6)]
            public float[] Features { get; set; }
        }

and this is the dataset: https://github.com/dotnet/machinelearning/blob/master/test/data/adult.tiny.with-schema.txt.

@Ivanidzo4ka
Copy link
Contributor

Does it complain on expected bool got float?
If it does I have PR which forces check input schema for first case. #2804

@yaeldekel
Copy link
Author

I think your PR may fix this issue as well as #1969, will try it again once it is merged.

@shauheen shauheen added this to the 0319 milestone Mar 12, 2019
@shauheen shauheen added the API Issues pertaining the friendly API label Mar 12, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Issues pertaining the friendly API
Projects
None yet
Development

No branches or pull requests

3 participants