machinelearning-samples
machinelearning-samples copied to clipboard
Invalid call to GetValue
I'm trying to implement this GetBestThreePredictions() in my code, but I keep getting this error and don't know how to fix it. Seems an error inside Microsoft.ML.DataViewSchema.
Is there anyone who can help me? Thanks
https://github.com/dotnet/machinelearning-samples/blob/c778296f22edaa21956f55db9e0a4a44d8ccf4b9/samples/csharp/end-to-end-apps/MulticlassClassification-GitHubLabeler/GitHubLabeler/GitHubLabelerConsoleApp/Labeler.cs#L81
@ImGere Hey, what is the error you are getting?
@Ivanidzo4ka - Ivan, since you are "the man" for this feature (Scores per prediction) could you help with this issue please? 👍
Help would be appreciated because I'm stuck with the development of this ML model since I need to be able to get back multiple values
Can you use GetKeyValues rather than GetSlotNames?
https://github.com/dotnet/machinelearning/blob/45b6c43387294d19cad843a21e87539213e8d34c/src/Microsoft.ML.Data/Data/SchemaAnnotationsExtensions.cs By the time we wrote sample GetKeyValues wasn't present, and I was confused by slot names.
Hi I tried what you suggested but stiil have the same error.
The library version is 1.2.0
Any progress on this issue?
Hi , Any progress on this issue?
Not from my side. I moved my work to Python and Scikit learn library.
I also check with GetSlotNames and GetKeyValues. But getting same error in both.
I am using version 1.5.0-preview
.
Any further updates for this issue?
I have the same error! I'm using version 1.4.0 Have you found a solution?
Unfortunately guys I'm not working on ML.NET anymore. You should create a new Issue under this repo since this can be hard to find.
Have a nice day!
using 1.5 and still get the same error! I recreated project with data now it is working and then I tried to update my old project with but again I got the same error. :(
How is this still not solved? I am getting the same error. I tried both GetKeyValues
and GetSlotNames
. cc @Ivanidzo4ka @CESARDELATORRE
I am using 1.5.2
Hi guys, this issue can easily be resolved by building the pipeline properly and extracting only the desired values. Check out my StackOverflow answer. I hope it helps, had a hard time figuring out a workaround. You don't necessarily need GetSlotNames
or GetKeyValues
to get your raw data.
I know this is an old question and you've either given up or solved it another way but I hope this helps someone.
I also struggled with this. I took the code from the "github tag" example project and used it in my project. I discovered that it only worked with "text" data types. In my need, if I made my inputs (which are naturally Single) into strings the above "GetSlotNames" f(x) worked. If I switched it back, it broke.
I can only assume this is an issue with the underlying framework not having the correct GetValue because if you inspect the data with the debugger the key mappings are there.
This can also be fixed by specifying addKeyValueAnnotationsAsText when mapping values to keys:
// e.g. CategoryId is an int column...
ml.Transforms.Conversion.MapValueToKey("Label", "CategoryId", addKeyValueAnnotationsAsText: true)