Problems with query points

21 次查看(过去 30 天)
Mark
Mark 2024-9-3,13:10
评论: Mark 2024-9-3,14:08
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

回答(1 个)

Steven Lord
Steven Lord 2024-9-3,13:43
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 个评论
Mark
Mark 2024-9-3,14:08
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by