-
Notifications
You must be signed in to change notification settings - Fork 1.9k
The first example is misleading. #5356
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
Comments
@philiplai Thanks for using ML.NET. This sample works for me, see the screenshot below: Please make sure you copy the full code sample, add latest version of ML.NET from nuget as reference and try again. If that still not working please share your repro project and a screenshot indicating problem so we can investigate. |
@philiplai if your problem is that you're trying to use In general this might be solved by using something like the following: var lastTransformer = ((TransformerChain <ITransformer>)model).LastTransformer;
var linearPredictor = (ISingleFeaturePredictionTransformer<object>)lastTransformer;
var permutationMetrics = mlContext.MulticlassClassification
.PermutationFeatureImportance(linearPredictor, transformedData,
permutationCount: 30); but as explained in the issue I linked above, the precise castings would depend on your particular scenario. |
Thanks! I made a mistake. Sorry! |
Feel free to reopen or raise new issue if you have any further question, close this issue now. |
Thanks, Frank. I got an error on var model = pipeline.Fit(data) after I plugged in my data. System.InvalidOperationException: 'The asynchronous operation has not completed.' Any ideas? |
Could you please share your code and data so I can take a look? |
My code is almost same as the example. It seems it is an known issue: |
I tried this method. But the program was stuck on this line of code below:
I have tried everything possible since the beginning of this year. Just can never get this feature work. |
@philiplai this looks like an bug introduced at latest 1.5.1 version of ML.NET, see similar issue for more context: so change the ML.NET version back to 1.5.0 should fix the asynchronous operation has not completed issue, please have a try, thanks. |
What are other issue that prevent you from using this feature? This async operation issue should only occurs at 1.5.1 |
Hi, @philiplai . It's not clear to me either if you can't run your code because of the
For this problem, please notice that PFI is a resource intensive algorithm, so it usually takes some time to execute and this isn't a bug, but the nature of the algorithm itself. It might also be the case that you might have several columns and this also affects the time it takes for PFI to run. You can take a look at what I've answered to another user who was having a similar problem with waiting time for PFI: notice that, as I explained there, some transformers create several (even thousands) of columns, and for these transformers PFI isn't suitable as it will take A LOT of time (several hours) and it wouldn't provide much useful information anyway. If you're able to share your code and/or model, along with your dataset, it could be easier to assess if this is causing your problem with PFI. |
Thank you, @frank-dong-ms @antoniovs1029 . After I downloaded the latest version, PFI was running. |
This line of code is simply not working.
var linearPredictor = model.LastTransformer;
There is no LastTransformer property.
Can someone post a working example?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: