Skip to content

Exception in CreditCard Fraud Detection sample while migrating to v0.11 #2821

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
prathyusha12345 opened this issue Mar 2, 2019 · 2 comments

Comments

@prathyusha12345
Copy link

Issue

  • While migrating CreditCard Fraud Detection sample I am getting the below exception while trying to save train/test data
                //(trainData, testData) = classification.TrainTestSplit(data, testFraction: 0.2, stratificationColumn: "Label");
                TrainTestData trainTestData = classification.TrainTestSplit(data, testFraction: 0.2);
                trainData = trainTestData.TrainSet;
                testData = trainTestData.TestSet;

                // save test split
                using (var fileStream = File.Create(Path.Combine(_outputPath, "testData.csv")))
                {
                    mlContext.Data.SaveAsText(testData, fileStream, separatorChar:',', headerRow:true, schema: true);
                }

image

@Ivanidzo4ka
Copy link
Contributor

please change your textloader options to allowQuote

@CESARDELATORRE
Copy link
Contributor

It was related to the fact that the DataSet Label file had the Boolean values in quotes, such as:

  • "1" (Instead of 1)
  • "0" (Instead of 0)

This is a side-effect/issue of turning off quoting by default in ML.NET:
#2630

I modified the original dataset so there are no quotes in the file, plus I refactored the sample so it is simpler.
I successfully migrated that sample to v0.11, so I'm closing this issue.

@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants