dotnet / machinelearning-modelbuilder

Simple UI tool to build custom machine learning models.
Creative Commons Attribution 4.0 International
260 stars 52 forks source link

mlnet classification error when amount of features increase #2784

Open superichmann opened 8 months ago

superichmann commented 8 months ago
mlnet --version
16.15.1+5cfa5322dc43fb36001cafd7c46e716141dfa219

Describe the bug mlnet classification error

System.Exception: Predict label not found: targetBool
   at Microsoft.ML.CLI.Commands.ClassificationCommand.ToTrainingConfiguration() in /_/src/mlnet/Commands/ClassificationCommand.cs:line 45
   at Microsoft.ML.CLI.Program.RunAutoMLCommandAndGetResult(AutoMLCommand command, Boolean skipGenerateConsoleApp) in /_/src/mlnet/Program.cs:line 365
   at Microsoft.ML.CLI.Program.<>c.<<CreateRootCommandLineBuilder>b__4_0>d.MoveNext() in /_/src/mlnet/Program.cs:line 90
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.ML.CLI.Program.<>c__DisplayClass4_0.<<CreateRootCommandLineBuilder>b__10>d.MoveNext() in /_/src/mlnet/Program.cs:line 325
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()

logfile:

2023-11-12 08:16:36.5523 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6061 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6061 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6061 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6061 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6181 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6181 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6181 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:36.6368 DEBUG System.FormatException: String ' available trainer: LGBM, RF, FASTTREE, LBFGS, SDCA ' was not recognized as a valid Boolean.
   at System.Boolean.Parse(ReadOnlySpan`1 value)
   at System.Boolean.Parse(String value)
   at Microsoft.ML.CLI.FeatureFlagManager.ReadFeatureFlags(String ffPath) in /_/src/mlnet/FeatureFlagManager.cs:line 69 (Microsoft.ML.CLI.FeatureFlagManager.ReadFeatureFlags)
2023-11-12 08:16:46.7951 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.8546 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.8546 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.8546 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.8546 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.8546 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.8546 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.8546 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
**2023-11-12 08:16:46.8740 DEBUG System.FormatException: String ' available trainer: LGBM, RF, FASTTREE, LBFGS, SDCA ' was not recognized as a valid Boolean.**
   at System.Boolean.Parse(ReadOnlySpan`1 value)
   at System.Boolean.Parse(String value)
   at Microsoft.ML.CLI.FeatureFlagManager.ReadFeatureFlags(String ffPath) in /_/src/mlnet/FeatureFlagManager.cs:line 69 (Microsoft.ML.CLI.FeatureFlagManager.ReadFeatureFlags)
2023-11-12 08:16:46.9418 DEBUG Set log file path to C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Commands.MLCommand.set_LogFilePath)
2023-11-12 08:16:46.9466 DEBUG Set log level to Info (Microsoft.ML.CLI.Commands.MLCommand.set_Verbosity)
2023-11-12 08:16:47.6344 ERROR System.Exception: Predict label not found: targetBool
   at Microsoft.ML.CLI.Commands.ClassificationCommand.ToTrainingConfiguration() in /_/src/mlnet/Commands/ClassificationCommand.cs:line 45
   at Microsoft.ML.CLI.Program.RunAutoMLCommandAndGetResult(AutoMLCommand command, Boolean skipGenerateConsoleApp) in /_/src/mlnet/Program.cs:line 365
   at Microsoft.ML.CLI.Program.<>c.<<CreateRootCommandLineBuilder>b__4_0>d.MoveNext() in /_/src/mlnet/Program.cs:line 90
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.ML.CLI.Program.<>c__DisplayClass4_0.<<CreateRootCommandLineBuilder>b__10>d.MoveNext() in /_/src/mlnet/Program.cs:line 325
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext() (Microsoft.ML.CLI.Program+<>c__DisplayClass4_0.<CreateRootCommandLineBuilder>b__8)
2023-11-12 08:16:47.6344 DEBUG System.Exception: Predict label not found: targetBool
   at Microsoft.ML.CLI.Commands.ClassificationCommand.ToTrainingConfiguration() in /_/src/mlnet/Commands/ClassificationCommand.cs:line 45
   at Microsoft.ML.CLI.Program.RunAutoMLCommandAndGetResult(AutoMLCommand command, Boolean skipGenerateConsoleApp) in /_/src/mlnet/Program.cs:line 365
   at Microsoft.ML.CLI.Program.<>c.<<CreateRootCommandLineBuilder>b__4_0>d.MoveNext() in /_/src/mlnet/Program.cs:line 90
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.ML.CLI.Program.<>c__DisplayClass4_0.<<CreateRootCommandLineBuilder>b__10>d.MoveNext() in /_/src/mlnet/Program.cs:line 325
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext() (Microsoft.ML.CLI.Program+<>c__DisplayClass4_0.<CreateRootCommandLineBuilder>b__8)
2023-11-12 08:16:47.6493 INFO Check out log file for more information: C:\Users\X\AppData\Local\Temp\mlnet\log.txt (Microsoft.ML.CLI.Program+<>c__DisplayClass4_0.<CreateRootCommandLineBuilder>b__8)
2023-11-12 08:16:47.6493 INFO Exiting ... (Microsoft.ML.CLI.Program+<>c__DisplayClass4_0.<CreateRootCommandLineBuilder>b__8)

To Reproduce download working.csv mlnet classification --dataset working.csv --label-col targetBool yay working :)

download error.csv mlnet classification --dataset error.csv --label-col targetBool NOT working :(

Expected behavior error.csv should also run properly

LittleLittleCloud commented 7 months ago

@superichmann We have report this bug to Prose team which is our partner team on parsing csv dataset. In the meantime, one workaround you can do is to remove the header of error.csv and use the following command

mlnet classification --dataset error.csv --label-col 20 --has-header false