Problems with query points

6 visualizzazioni (ultimi 30 giorni)
Mark
Mark il 3 Set 2024
Commentato: Mark il 3 Set 2024
Hi,
I'm having problems with the codes for query points according to the tutorial based on:
I've followed both the tutorial and tried to implement it on my own data, but both instances I run into the exact same issue.
Following the step:
explainer = fit(explainer,tbl,UseParallel=true); % I have tried this both with and without the UseParallel bit
After attempting this, I receive the following error message:
Error using fit
Expected queryPoint to be a row vector.
Error in shapley/fit (line 424)
validateattributes(q, {'double','single','table'},{'row','nonempty'},'fit','queryPoint');
I'm really not sure what the issue is here as neither the tutorial data or my own work at this point. Any help will be greatly appreciated

Risposte (1)

Steven Lord
Steven Lord il 3 Set 2024
According to the information you provided when you asked the question, you're using release R2023b. Looking at the documentation page for the fit method on shapley objects, I see that there was a change to the function in release R2024a that allows multiple query points. Are you trying to pass multiple query points into the function in an earlier release? I don't think that's going to work. To check this, try running the examples on the documentation page for the documentation installed with your release (or in the release R2023b documentation online) and see if it works with those examples.
If that doesn't explain the behavior you're seeing, what is the size and class of the tbl variable you're passing into the fit function as the second input?
  1 Commento
Mark
Mark il 3 Set 2024
Hi Steven,
Thank you for your reply.
I'm not sure what the purpose of the query points is as I've seen no mention of it on the document page I linked, at least for the section I'm trying to do. (Side note, I'm just having problems with them anyway when it comes to classification and have asked a seperate question).
But as you suggested, I have tried to follow the examples that are provided as well as my own and in both instances ran into the same error at the same point. In my case, the tbl variable I am using is an 86x19 table consisting of purely numerical predictors.

Accedi per commentare.

Prodotti


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by